Updated cmake messages

This commit is contained in:
gabime 2023-12-23 17:16:24 +02:00
parent 3b93c53e33
commit 8a0f87406b
2 changed files with 16 additions and 4 deletions

View File

@ -11,7 +11,6 @@ include(cmake/ide.cmake)
spdlog_extract_version() spdlog_extract_version()
project(spdlog VERSION ${SPDLOG_VERSION} LANGUAGES CXX) project(spdlog VERSION ${SPDLOG_VERSION} LANGUAGES CXX)
message(STATUS "Build spdlog: ${SPDLOG_VERSION}")
include(GNUInstallDirs) include(GNUInstallDirs)
@ -130,16 +129,29 @@ if(SPDLOG_BUILD_SHARED)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif() 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(NOT SPDLOG_USE_STD_FORMAT)
if (SPDLOG_FMT_EXTERNAL) if (SPDLOG_FMT_EXTERNAL)
find_package(fmt REQUIRED) find_package(fmt REQUIRED)
message(STATUS "Using external fmt lib version: ${fmt_VERSION}")
else() else()
include(cmake/fmtlib.cmake) include(cmake/fmtlib.cmake)
endif() endif()
endif() endif()
# ---------------------------------------------------------------------------------------
# Threads library is required
# ---------------------------------------------------------------------------------------
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
# Library sources # Library sources
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------

View File

@ -1,6 +1,5 @@
include(FetchContent) include(FetchContent)
Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare( FetchContent_Declare(
fmt fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_REPOSITORY https://github.com/fmtlib/fmt.git
@ -10,9 +9,10 @@ FetchContent_Declare(
FetchContent_GetProperties(fmt) FetchContent_GetProperties(fmt)
if(NOT fmt_POPULATED) if(NOT fmt_POPULATED)
message(STATUS "Fetching fmt lib...")
FetchContent_Populate(fmt) FetchContent_Populate(fmt)
# We do not require os features of fmt # We do not require os features of fmt
set(FMT_OS OFF CACHE BOOL "Disable FMT_OS" FORCE) 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 () endif ()