diff options
author | Slávek Banko <[email protected]> | 2025-01-13 22:03:57 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2025-01-14 02:34:02 +0100 |
commit | 353adbbaf53bf627f92ea00e31ae4ef116656e3a (patch) | |
tree | a1df04c2c09f278816c606a6e50bb99417ef17f1 | |
parent | 6d754b3d8ee2a62a4784b6a659c46acdd22dd40e (diff) | |
download | tde-cmake-353adbbaf53bf627f92ea00e31ae4ef116656e3a.tar.gz tde-cmake-353adbbaf53bf627f92ea00e31ae4ef116656e3a.zip |
Use CMake command create_symlink instead of calling ls -s,r14.1.x
because it is resistant to repeated calls.
This solves FTBFS with CMake >= 3.11, because in the case of update
a library file, as a result of a tdelfeditor call, this will cause
repeated calls for targets that are dependent on the library.
As a result, it is now possible to use call based on POST_BUILD,
and there is no need to distinguish the way of calling created in
the commit e22f5ace4a1eae9b299a8b8c60ceb339c73a2e3c.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit e1b441631c31d8ab9269bd44d1a992af6424ccdd)
-rw-r--r-- | modules/TDEMacros.cmake | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index e2db7e0..0b59eb4 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1263,22 +1263,12 @@ macro( tde_add_library _arg_target ) get_target_property( _soversion ${_target} SOVERSION ) set( _soname "${_soname}.${_soversion}" ) endif( ) - 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( ) + add_custom_command( + TARGET ${_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink + "${_soname}" + "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}" + ) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${_soname_base}" DESTINATION ${_destination} ) endif( ) |