summaryrefslogtreecommitdiffstats
path: root/modules/TDEMacros.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-11-29 01:15:39 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-11-29 19:41:45 +0100
commite5b3a250fcbddc2d153832a386a7b67b340b8dac (patch)
tree99b38e3b9a19882e72544168b1db71f61d2a58d4 /modules/TDEMacros.cmake
parentf87cec4baae8c7bc02850edef84ac1d219df82b6 (diff)
downloadtde-cmake-e5b3a250fcbddc2d153832a386a7b67b340b8dac.tar.gz
tde-cmake-e5b3a250fcbddc2d153832a386a7b67b340b8dac.zip
Use POSITION_INDEPENDENT_CODE property for CMake >= 2.8.9.
This resolves bug 2985. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r--modules/TDEMacros.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 729d50f..fc6e99e 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -773,7 +773,11 @@ macro( tde_add_library _arg_target )
# set -fPIC flag for static libraries
if( _static_pic )
- set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
+ if( "${CMAKE_VERSION}" VERSION_LESS "2.8.9" )
+ set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
+ else( )
+ set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
+ endif( )
endif( _static_pic )
# set version