From e5b3a250fcbddc2d153832a386a7b67b340b8dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 29 Nov 2018 01:15:39 +0100 Subject: [PATCH] Use POSITION_INDEPENDENT_CODE property for CMake >= 2.8.9. This resolves bug 2985. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- modules/TDEMacros.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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