CMake file (INSTALL files DESTINATION dir) with symbolic links

I use FILE (INSTALL) files, but some of them are symbolic links. Can I tell CMake to dereference a symbolic link instead of creating a symbolic link at the destination?

+4
source share
1 answer

You can dereference files programmatically before passing them to install(FILES ...) :

 set (_resolvedFiles "") foreach (_file ${_files}) get_filename_component(_resolvedFile "${_file}" REALPATH) list (APPEND _resolvedFiles "${_resolvedFile}") endforeach() install(FILES ${_resolvedFiles} DESTINATION ${_dest}) 
+8
source

Source: https://habr.com/ru/post/975679/


All Articles