I am using FILE(INSTALL files) but some of the files are symbolic links. Can I tell CMake to dereference the symbolic link instead of creating a symbolic link on destination?
New in version 3.12: If the CONFIGURE_DEPENDS flag is specified, CMake will add logic to the main build system check target to rerun the flagged GLOB commands at build time. If any of the outputs change, CMake will regenerate the build system. We do not recommend using GLOB to collect a list of source files from your source tree.
This command is dedicated to file and path manipulation requiring access to the filesystem. For other path manipulation, handling only syntactic aspects, have a look at cmake_path () command.
A specific OUTPUT file may be named by at most one invocation of file (GENERATE) . Generated files are modified and their timestamp updated on subsequent cmake runs only if their content is changed. Note also that file (GENERATE) does not create the output file until the generation phase.
If a file does not exist it will be silently ignored. With TOUCH and TOUCH_NOCREATE the contents of an existing file will not be modified. Generate an output file for each build configuration supported by the current CMake Generator.
You can dereference the 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})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With