Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabi Melman <gmelman1@gmail.com>2019-05-19 17:06:22 +0300
committerGitHub <noreply@github.com>2019-05-19 17:06:22 +0300
commita532a072cee5841b8fb8bd766c491ae24fa48d13 (patch)
treeab5edd3f6581729b8a1949c75969a219551541e2 /CMakeLists.txt
parent2cd53c6ff1e057349e8a2c6db2f05ab27f767fdd (diff)
Update CMakeLists.txt
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 2 insertions, 10 deletions
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 ()
-