diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-06-11 17:11:53 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-06-12 13:36:25 +0200 |
commit | fd16e820bfced9857cb545f28c560c2152582475 (patch) | |
tree | 5e4d6b02efd656c54e0883e275068db6b5706fdf | |
parent | e28a7be8ab798856462f9889a4e54027c0c1a9be (diff) | |
download | tde-cmake-fd16e820bfced9857cb545f28c560c2152582475.tar.gz tde-cmake-fd16e820bfced9857cb545f28c560c2152582475.zip |
tde_add_library: Add the ability to link libraries as private.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit d504c98bb7342c38764c83f3f3c0c31eb6834f18)
-rw-r--r-- | modules/TDEMacros.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index a4f6320..fae7f3e 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -787,6 +787,7 @@ macro( tde_add_library _arg_target ) unset( _destination ) unset( _embed ) unset( _link ) + unset( _link_private ) unset( _dependencies ) unset( _storage ) unset( _exclude_from_all ) @@ -866,6 +867,12 @@ macro( tde_add_library _arg_target ) set( _storage "_link" ) endif( "+${_arg}" STREQUAL "+LINK" ) + # found directive "LINK_PRIVATE" + if( "+${_arg}" STREQUAL "+LINK_PRIVATE" ) + set( _skip_store 1 ) + set( _storage "_link_private" ) + endif( "+${_arg}" STREQUAL "+LINK_PRIVATE" ) + # found directive "DEPENDENCIES" if( "+${_arg}" STREQUAL "+DEPENDENCIES" ) set( _skip_store 1 ) @@ -991,6 +998,17 @@ macro( tde_add_library _arg_target ) endif( ) endif( _embed ) + # set private linked libraries + if( _link_private ) + if( NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12" ) + if( _link ) + list( INSERT _link 0 "PUBLIC" ) + endif() + list( APPEND _link "PRIVATE" ) + endif() + list( APPEND _link ${_link_private} ) + endif( _link_private ) + # set link libraries if( _link ) if( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" ) |