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:
authorgabime <gmelman1@gmail.com>2019-06-10 18:09:36 +0300
committergabime <gmelman1@gmail.com>2019-06-10 18:09:36 +0300
commit68a0193d952eb0b39ccb54e3a8c60b72c3f189a9 (patch)
treef9ea9ecdbc6752ccfd95db94b125e2a286c07fdc /CMakeLists.txt
parent80740f0e46034a2b958238858aa49f37acd60288 (diff)
CMake refactoring to functions
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 3 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcc54309..519233cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,8 @@ cmake_minimum_required(VERSION 3.1)
#---------------------------------------------------------------------------------------
# Start spdlog project
#---------------------------------------------------------------------------------------
-include(cmake/version.cmake)
+include(cmake/utils.cmake)
+spdlog_extract_version()
project(spdlog VERSION ${SPDLOG_VERSION} LANGUAGES CXX)
message(STATUS "Build spdlog: ${SPDLOG_VERSION}")
@@ -49,7 +50,6 @@ option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF)
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
-
find_package(Threads REQUIRED)
#---------------------------------------------------------------------------------------
@@ -63,6 +63,7 @@ target_include_directories(spdlog PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(spdlog PUBLIC Threads::Threads)
+spdlog_enable_warnings(spdlog)
#---------------------------------------------------------------------------------------
# Header only version
@@ -75,19 +76,6 @@ target_include_directories(spdlog_header_only INTERFACE
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(spdlog_header_only INTERFACE Threads::Threads)
-#---------------------------------------------------------------------------------------
-# Turn on compiler warnings and sanitizers if we build our own project
-#---------------------------------------------------------------------------------------
-if(SPDLOG_MASTER_PROJECT)
- if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
- target_compile_options( spdlog PRIVATE -Wall -Wextra -Wconversion -pedantic -Wfatal-errors)
- endif()
- if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- target_compile_options( spdlog PRIVATE /W3 /WX )
- endif()
-
- include(cmake/sanitizers.cmake)
-endif()
#---------------------------------------------------------------------------------------
# use fmt package if using exertnal fmt