diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-12-23 12:42:22 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-12-23 12:42:55 +0100 |
commit | ce8049e3aaaff3db116650b6e1af1bbcc5fe35f0 (patch) | |
tree | 2e93b3d7586f5e0e89c2ad29b69dd5326944b8db | |
parent | 541bb2f48af73c6ddce1a8c1f992a9cbf52b7102 (diff) | |
download | tde-cmake-ce8049e3.tar.gz tde-cmake-ce8049e3.zip |
Fix build with cmake >= 2.8.12
This resolves Bug 1759
-rw-r--r-- | modules/TDEMacros.cmake | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 25b14b0..beeee18 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -685,15 +685,16 @@ macro( tde_add_library _arg_target ) # set interface libraries (only for shared) unset( _shared_libs ) - foreach( _lib ${_link} ) - #get_target_property( _lib_type ${_lib} TYPE ) - #if( NOT "STATIC_LIBRARY" STREQUAL "${_lib_type}" ) - if( NOT ${_lib} MATCHES ".+-static" ) - list( APPEND _shared_libs ${_lib} ) - endif( NOT ${_lib} MATCHES ".+-static" ) - #endif( NOT "STATIC_LIBRARY" STREQUAL "${_lib_type}" ) - endforeach( _lib ) - target_link_libraries( ${_target} LINK_INTERFACE_LIBRARIES ${_shared_libs} ) + if( NOT ${_type} STREQUAL "STATIC" ) + foreach( _lib ${_link} ) + #get_target_property( _lib_type ${_lib} TYPE ) + #if( NOT "STATIC_LIBRARY" STREQUAL "${_lib_type}" ) + if( NOT ${_lib} MATCHES ".+-static" ) + list( APPEND _shared_libs ${_lib} ) + endif( NOT ${_lib} MATCHES ".+-static" ) + #endif( NOT "STATIC_LIBRARY" STREQUAL "${_lib_type}" ) + endforeach( _lib ) + endif( NOT ${_type} STREQUAL "STATIC" ) # set embedded archives if( _embed ) @@ -702,8 +703,18 @@ macro( tde_add_library _arg_target ) # set link libraries if( _link ) - target_link_libraries( ${_target} ${_link} ) + if( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" ) + # hack for broken CMake 2.8.12.0 + set_target_properties( ${_target} PROPERTIES LINK_LIBRARIES "${_link}" ) + else( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" ) + target_link_libraries( ${_target} ${_link} ) + endif( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" ) endif( ) + if( _shared_libs ) + set_target_properties( ${_target} PROPERTIES + LINK_INTERFACE_LIBRARIES "${_shared_libs}" + INTERFACE_LINK_LIBRARIES "${_shared_libs}" ) + endif( _shared_libs ) # set dependencies if( _dependencies ) |