diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-04-08 04:40:39 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-04-08 09:28:57 +0200 |
commit | ca47fa83300e843f1e469e3f455e58aa299e1e9d (patch) | |
tree | cb9f93f743f158387b2488c4621b4844a42102e9 | |
parent | 66dda475f9f54eb9b87466676dca3ef4dc84daa6 (diff) | |
download | tde-cmake-r14.0.8.tar.gz tde-cmake-r14.0.8.zip |
Create symlink for base soname for libraries with release number in the namer14.0.8
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>
(cherry picked from commit e22f5ace4a1eae9b299a8b8c60ceb339c73a2e3c)
-rw-r--r-- | modules/TDEMacros.cmake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index a6f52df..0a0b784 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( ) |