diff --git a/CMakeLists.txt b/CMakeLists.txt index 789f8123..4723a8a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ include(cmake/ide.cmake) spdlog_extract_version() project(spdlog VERSION ${SPDLOG_VERSION} LANGUAGES CXX) -message(STATUS "Build spdlog: ${SPDLOG_VERSION}") include(GNUInstallDirs) @@ -130,16 +129,29 @@ if(SPDLOG_BUILD_SHARED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +message(STATUS "spdlog version: ${SPDLOG_VERSION}") +message(STATUS "spdlog build type: " ${CMAKE_BUILD_TYPE}) +message(STATUS "spdlog build shared: " ${BUILD_SHARED_LIBS}) +message(STATUS "spdlog use std format: " ${SPDLOG_USE_STD_FORMAT}) +message(STATUS "spdlog fmt external: " ${SPDLOG_FMT_EXTERNAL}) + +# --------------------------------------------------------------------------------------- +# Find {fmt} library if not using std::format +# --------------------------------------------------------------------------------------- if(NOT SPDLOG_USE_STD_FORMAT) if (SPDLOG_FMT_EXTERNAL) find_package(fmt REQUIRED) + message(STATUS "Using external fmt lib version: ${fmt_VERSION}") else() include(cmake/fmtlib.cmake) endif() endif() +# --------------------------------------------------------------------------------------- +# Threads library is required +# --------------------------------------------------------------------------------------- find_package(Threads REQUIRED) -message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) + # --------------------------------------------------------------------------------------- # Library sources # --------------------------------------------------------------------------------------- diff --git a/cmake/fmtlib.cmake b/cmake/fmtlib.cmake index 2f63d9fe..bc77752b 100644 --- a/cmake/fmtlib.cmake +++ b/cmake/fmtlib.cmake @@ -1,6 +1,5 @@ include(FetchContent) -Set(FETCHCONTENT_QUIET FALSE) FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git @@ -10,9 +9,10 @@ FetchContent_Declare( FetchContent_GetProperties(fmt) if(NOT fmt_POPULATED) + message(STATUS "Fetching fmt lib...") FetchContent_Populate(fmt) # We do not require os features of fmt set(FMT_OS OFF CACHE BOOL "Disable FMT_OS" FORCE) - add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR}) + add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR} EXCLUDE_FROM_ALL) endif ()