From dd2f293f339afa0a5a3637c7c4c890b43a76e12b Mon Sep 17 00:00:00 2001 From: David Zemon Date: Fri, 17 May 2019 23:33:44 -0500 Subject: [PATCH] Clean up CMake a bit more --- CMakeLists.txt | 9 ++++----- tests/CMakeLists.txt | 10 +++------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba146ca1..a8e2f2ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,8 +54,6 @@ option(SPDLOG_BUILD_TESTS "Build tests" ON) option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF) option(SPDLOG_INSTALL "Generate the install target." ${SPDLOG_MASTER_PROJECT}) -set(HEADER_BASE "${CMAKE_CURRENT_SOURCE_DIR}/include/spdlog") - message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) find_package(Threads REQUIRED) @@ -63,9 +61,10 @@ find_package(Threads REQUIRED) # Build library add_library(spdlog src/spdlog.cpp) target_compile_definitions(spdlog PUBLIC SPDLOG_COMPILED_LIB ) -target_include_directories(spdlog PUBLIC "$") -set_target_properties(spdlog PROPERTIES OUTPUT_NAME "spdlog") -set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX "-debug") +target_include_directories(spdlog PUBLIC + "$" + "$" +) target_link_libraries(spdlog PUBLIC Threads::Threads) # Header only diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f02dea91..3275694a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,3 @@ -project(spdlog-utests CXX) - -find_package(Threads REQUIRED) - set(SPDLOG_UTESTS_SOURCES test_errors.cpp test_file_helper.cpp @@ -19,10 +15,10 @@ set(SPDLOG_UTESTS_SOURCES test_sink.h test_fmt_helper.cpp) -add_executable(${PROJECT_NAME} ${SPDLOG_UTESTS_SOURCES}) -target_link_libraries(${PROJECT_NAME} PRIVATE spdlog) +add_executable(spdlog-utests ${SPDLOG_UTESTS_SOURCES}) +target_link_libraries(spdlog-utests spdlog) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") enable_testing() -add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) +add_test(NAME spdlog-utests COMMAND spdlog-utests)