diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-04-27 08:13:08 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-04-27 08:13:08 -0700 |
commit | 51322cffa1b9c69a28b89a239ebe7133fa4cdda2 (patch) | |
tree | 4aaa993437eeafa204ff09957cef6053673ca81b | |
parent | c53fdab93af76106b963216d85897614b996f8b6 (diff) |
Move CMake build postfix setup behind an off-by-default USE_POSTFIX
This setup can interfere with existing workflows in two ways:
- If the target application used CMake and configured custom postfixes,
this change would override them
- If the target application did *not* use CMake, it'd have to abide by
these conventions even if the target configuration used is unexpected -
for example, the default "preferred" configuration is frequently
RelWithDebugInfo, not Release, which now has a postfix.
Fixes #198.
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a2b150d..e95e6c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(pugixml) option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF) option(BUILD_TESTS "Build tests" OFF) option(USE_VERSIONED_LIBDIR "Use a private subdirectory to install the headers and libs" OFF) +option(USE_POSTFIX "Use separate postfix for each configuration to make sure you can install multiple build outputs" OFF) set(BUILD_DEFINES "" CACHE STRING "Build defines") @@ -64,7 +65,7 @@ target_include_directories(pugixml PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX}>) -if(CMAKE_CONFIGURATION_TYPES) +if(USE_POSTFIX AND CMAKE_CONFIGURATION_TYPES) set_target_properties(pugixml PROPERTIES DEBUG_POSTFIX "_d" MINSIZEREL_POSTFIX "_m" RELWITHDEBINFO_POSTFIX "_r") endif() |