From 51322cffa1b9c69a28b89a239ebe7133fa4cdda2 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 27 Apr 2018 08:13:08 -0700 Subject: 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. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 $ $) -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() -- cgit v1.2.3