I'm using cmake to copy a soft link 'libbssl.so' (which has target libssl.so.3) to a build subdirectory.
COMMAND ${CMAKE_COMMAND} -E copy ${OPENSSL_SSL_LIBRARY} ${CMAKE_CURRENT_BINARY_DIR}/lib
The copy command works as expected and copies the file, however with libssl.so as the filename and not libssl.so.3. How do I get cmake to save the filename as libssl.so.3 keeping in mind that I don't necessarily know this name in advance, i.e., I don't want to hard code it. I'm using find_package(OpenSSL).
I don't know about a convenient way to use the cmake command linke tool for this directly, but starting CMake 3.15, cmake provides the
FOLLOW_SYMLINK_CHAIN
forfile(COPY)
for copying the library file including the full symlink chain to the target directory.You could create a cmake script to execute as command.
copy_symlink_chain.cmake