Skip to content

Commit 06592e4

Browse files
joshuachpjunekimdev
authored andcommitted
chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (gabime#3433)
This will make it possible to use the pkg-config with CMake debug build.
1 parent 8c75f99 commit 06592e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled heade
6262
# build position independent code
6363
option(SPDLOG_BUILD_PIC "Build position independent code (-fPIC)" OFF)
6464

65+
# debug build postfix
66+
set(SPDLOG_DEBUG_POSTFIX "d" CACHE STRING "Filename postfix for libraries in debug builds")
67+
6568
# example options
6669
option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT})
6770
option(SPDLOG_BUILD_EXAMPLE_HO "Build header only example" OFF)
@@ -191,7 +194,7 @@ spdlog_enable_warnings(spdlog)
191194

192195
set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION
193196
${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR})
194-
set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX d)
197+
set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX ${SPDLOG_DEBUG_POSTFIX})
195198

196199
if(COMMAND target_precompile_headers AND SPDLOG_ENABLE_PCH)
197200
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pch.h.in ${PROJECT_BINARY_DIR}/spdlog_pch.h @ONLY)

0 commit comments

Comments
 (0)