summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-04-08 04:40:39 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-04-08 04:40:39 +0200
commite22f5ace4a1eae9b299a8b8c60ceb339c73a2e3c (patch)
treeeb96eed1817a9f30a3088ca5d6ca5c1a7299bd6c
parent48b1e42b64d8c5c47461db1bf0ca3db9ce3fe726 (diff)
downloadcmake-e22f5ace4a1eae9b299a8b8c60ceb339c73a2e3c.tar.gz
cmake-e22f5ace4a1eae9b299a8b8c60ceb339c73a2e3c.zip
Create symlink for base soname for libraries with release number in the name
as a separate target instead of POST_BUILD command. This prevents the command from being executed multiple times and thus FTBFS. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--modules/TDEMacros.cmake18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 23de3ee..da8ed4f 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -939,8 +939,22 @@ macro( tde_add_library _arg_target )
get_target_property( _soversion ${_target} SOVERSION )
set( _soname "${_soname}.${_soversion}" )
endif( )
- add_custom_command( TARGET ${_target} POST_BUILD
- COMMAND ln -s ${_soname} "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}" )
+ if( NOT _exclude_from_all )
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}"
+ COMMAND ln -s ${_soname} "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}"
+ DEPENDS ${_target}
+ )
+ add_custom_target(
+ ${_target}+base-so ALL
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}"
+ )
+ else( )
+ add_custom_command(
+ TARGET ${_target} POST_BUILD
+ COMMAND ln -s ${_soname} "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}"
+ )
+ endif( )
install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}" DESTINATION ${_destination} )
endif( )