From 7b0b4bb56d49c6f5e5df1c5a04220abba711bfe2 Mon Sep 17 00:00:00 2001 From: Joshua Chapman Date: Mon, 30 Jun 2025 15:41:03 +0200 Subject: [PATCH] chore(cmake): add option to override CMAKE_DEBUG_POSTFIX This will make it possible to use the pkg-config with CMake debug build. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3368e4dd..882aa90e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,9 @@ option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled heade # build position independent code option(SPDLOG_BUILD_PIC "Build position independent code (-fPIC)" OFF) +# debug build postfix +set(SPDLOG_DEBUG_POSTFIX "d" CACHE STRING "Filename postfix for libraries in debug builds") + # example options option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT}) option(SPDLOG_BUILD_EXAMPLE_HO "Build header only example" OFF) @@ -191,7 +194,7 @@ spdlog_enable_warnings(spdlog) set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION ${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}) -set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX d) +set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX ${SPDLOG_DEBUG_POSTFIX}) if(COMMAND target_precompile_headers AND SPDLOG_ENABLE_PCH) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pch.h.in ${PROJECT_BINARY_DIR}/spdlog_pch.h @ONLY)