Use POSITION_INDEPENDENT_CODE property for CMake >= 2.8.9.

This resolves bug 2985.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e5b3a250fc)
r14.0.x
Slávek Banko 6 years ago
parent 529bdf2f48
commit ed0d46cb47
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

Loading…
Cancel
Save