Use CMake command create_symlink instead of calling ls -s,

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 e22f5ace4a.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e1b441631c)
r14.1.x
Slávek Banko 1 month ago
parent 6d754b3d8e
commit 353adbbaf5
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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( )

Loading…
Cancel
Save