Merge pull request #635 from DanielChabrowski/cmake_explicit_lang

CMake explicit language
This commit is contained in:
Gabi Melman 2018-02-12 01:16:49 +02:00 committed by GitHub
commit 8cfd71a9be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 74 deletions

View File

@ -4,7 +4,7 @@
# #
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(spdlog VERSION 0.16.3) project(spdlog VERSION 0.16.3 LANGUAGES CXX)
include(CTest) include(CTest)
include(CMakeDependentOption) include(CMakeDependentOption)
include(GNUInstallDirs) include(GNUInstallDirs)
@ -73,7 +73,6 @@ configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY)
install( install(
TARGETS spdlog TARGETS spdlog
EXPORT "${targets_export_name}" EXPORT "${targets_export_name}"
INCLUDES DESTINATION "${include_install_dir}"
) )
# install headers # install headers

View File

@ -21,8 +21,8 @@
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# *************************************************************************/ # *************************************************************************/
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.1)
project(SpdlogExamples) project(SpdlogExamples CXX)
if(TARGET spdlog) if(TARGET spdlog)
# Part of the main project # Part of the main project
@ -32,16 +32,16 @@ else()
find_package(spdlog CONFIG REQUIRED) find_package(spdlog CONFIG REQUIRED)
endif() endif()
find_package(Threads) find_package(Threads REQUIRED)
add_executable(example example.cpp) add_executable(example example.cpp)
target_link_libraries(example spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(example spdlog::spdlog Threads::Threads)
add_executable(benchmark bench.cpp) add_executable(benchmark bench.cpp)
target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(benchmark spdlog::spdlog Threads::Threads)
add_executable(multisink multisink.cpp) add_executable(multisink multisink.cpp)
target_link_libraries(multisink spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(multisink spdlog::spdlog Threads::Threads)
enable_testing() enable_testing()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")

View File

@ -1,4 +1,4 @@
project(spdlog-utests) project(spdlog-utests CXX)
enable_testing() enable_testing()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)