From a532a072cee5841b8fb8bd766c491ae24fa48d13 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sun, 19 May 2019 17:06:22 +0300 Subject: Update CMakeLists.txt --- CMakeLists.txt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 57307b15..c55fa191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,6 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE) endif() - - #--------------------------------------------------------------------------------------- # compiler config #--------------------------------------------------------------------------------------- @@ -29,13 +27,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH add_compile_options("-Wfatal-errors") endif() - - #--------------------------------------------------------------------------------------- # spdlog target #--------------------------------------------------------------------------------------- - # Check if spdlog is being used directly or via add_subdirectory, but allow overriding if (NOT DEFINED SPDLOG_MASTER_PROJECT) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) @@ -55,7 +50,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) find_package(Threads REQUIRED) -# Build library +# Static library version add_library(spdlog src/spdlog.cpp) target_compile_definitions(spdlog PUBLIC SPDLOG_COMPILED_LIB) target_include_directories(spdlog PUBLIC @@ -65,12 +60,11 @@ target_include_directories(spdlog PUBLIC target_link_libraries(spdlog PUBLIC Threads::Threads) -# Header only +# Header only version add_library(spdlog_header_only INTERFACE) target_include_directories(spdlog_header_only INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include") target_link_libraries(spdlog_header_only INTERFACE Threads::Threads) - #--------------------------------------------------------------------------------------- # address sanitizers check #--------------------------------------------------------------------------------------- @@ -151,7 +145,5 @@ if (SPDLOG_INSTALL) #--------------------------------------------------------------------------------------- option(CMAKE_EXPORT_NO_PACKAGE_REGISTRY "Disable registration of CMake's build directory." ON) export(PACKAGE ${PROJECT_NAME}) - endif () - -- cgit v1.2.3