11

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?

André Puel
  • 8,741
  • 9
  • 52
  • 83
  • 1
    Please, if you think the answer is correct mark is as answer, it worked for me and I guess I would find it faster if it would be marked as correct answer – kreuzerkrieg Feb 27 '19 at 19:11

1 Answers1

21

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})
sakra
  • 62,199
  • 16
  • 168
  • 151