Skip to content

Commit

Permalink
fix DigitalInBlue#171: [cmake] add option to disable setting CMAKE_<B…
Browse files Browse the repository at this point in the history
…UILD_TYPE>_POSTFIX

setting in cache might spill it into a consuming project, when
celero is added via FetchContent.
  • Loading branch information
ferkulat committed Oct 6, 2023
1 parent 6646a8f commit 4ad2db8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ option(CELERO_ENABLE_EXPERIMENTS "Set to ON to automatically build all examples.
option(CELERO_ENABLE_FOLDERS "Enable to put Celero in its own solution folder under Visual Studio" ON)
option(CELERO_ENABLE_TESTS "Enable building and running unit tests." OFF)
option(CELERO_TREAT_WARNINGS_AS_ERRORS "Treat compile warnings as errors." ON)
option(CELERO_SET_LIBRARY_POSTFIX "Set OFF to prevent celero setting cache variables for CMAKE_<BUILDTYPE>_POSTFIX." ON)

if(CELERO_COMPILE_DYNAMIC_LIBRARIES)
SET(CELERO_USER_DEFINED_SHARED_OR_STATIC "SHARED")
Expand All @@ -120,11 +121,12 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "add a postfix, usually d on windows")
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_RELWITHDEBINFO_POSTFIX "-rd" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")

if(CELERO_SET_LIBRARY_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "add a postfix, usually d on windows")
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_RELWITHDEBINFO_POSTFIX "-rd" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# ---------------------------------------------------------------------------
Expand Down

0 comments on commit 4ad2db8

Please sign in to comment.