aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeflinhec <falconlegend810518@gmail.com>2020-04-29 20:29:52 +0800
committerAlec Thomas <alec@swapoff.org>2020-05-01 23:28:08 +1000
commit014d3ef82db65e9e86c05da425838b6a0a623af9 (patch)
tree26f18b3c183af51e549a9ec05397067aa313d408
parent13b01f9d311b274a4f22370168229207b8caa1d5 (diff)
Make debug postfix optional
Library debug postfix might not be suitable for cross platform project, and usually require extra work of link against prebuilt yaml-cpp. Generally, Xcode project output library to these directories: Debug Release Debug-iphoneos Release-iphoneos Debug-iphonesimulator Release-iphonesimulator Another Xcode project usually configured its build setting as follow, and expects library name to be same between Release and Debug LIBRARY_SEARCH_PATHS=$(CONFIGURATION)$(EFFECT_PLATFORM_NAME) OTHER_LDFLAGS= $(inherited) -lentityx
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a2b5d1..99da9a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,6 +118,9 @@ require(HAVE_STDINT_H "stdint.h")
# Things to install
+if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
+ set(CMAKE_DEBUG_POSTFIX "-d")
+endif()
set(sources entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/help/Timer.cc entityx/help/Pool.cc)
@@ -127,7 +130,7 @@ if (ENTITYX_BUILD_SHARED)
set_target_properties(entityx PROPERTIES
OUTPUT_NAME entityx
- DEBUG_POSTFIX -d
+ DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}"
VERSION ${ENTITYX_VERSION}
SOVERSION ${ENTITYX_MAJOR_VERSION}
FOLDER entityx)
@@ -136,7 +139,9 @@ if (ENTITYX_BUILD_SHARED)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
else()
add_library(entityx STATIC ${sources})
- set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx)
+ set_target_properties(entityx PROPERTIES
+ DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}"
+ FOLDER entityx)
set(install_libs entityx)
set_property(TARGET entityx APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)