0
0
mirror of https://github.com/zeux/pugixml.git synced 2025-01-14 09:57:57 +08:00

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.
This commit is contained in:
Arseny Kapoulkine 2018-04-27 08:13:08 -07:00
parent c53fdab93a
commit 51322cffa1

View File

@ -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()