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,263
  • 8
  • 46
  • 82
  • 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

20

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
  • 57,919
  • 14
  • 164
  • 145