Skip to content
Snippets Groups Projects
Commit 37f108ac authored by Patrick Nonn's avatar Patrick Nonn Committed by Martin Killenberg
Browse files

feat(project-template): conf-gen: follow symlinks at builddir creation

Instead of copying a symlink file, resulting in a broken link, the
target file is copied instead, unless the target is in the same
directory, in which case the symlink is maintained.
parent 28c0b4f2
No related branches found
No related tags found
1 merge request!8feat(project-template): conf-gen: follow symlinks at builddir creation
......@@ -27,7 +27,10 @@ set(DESTDIR share/ConfigGenerator-${PROJECT_NAME}-${${PROJECT_NAME}_MAJOR_VERSIO
file(GLOB hostlists RELATIVE ${PROJECT_SOURCE_DIR} */hostlist)
foreach(hostlist ${hostlists})
string(REPLACE "/hostlist" "" servertype "${hostlist}")
file(COPY "${PROJECT_SOURCE_DIR}/${servertype}" DESTINATION "${PROJECT_BINARY_DIR}")
# FOLLOW_SYMLINK_CHAIN is necessary to allow symlinks to git-submodules. This is used to create
# "derived" configurations which reuse some files from their base configuration (example: configs for
# different control systems)
file(COPY "${PROJECT_SOURCE_DIR}/${servertype}" DESTINATION "${PROJECT_BINARY_DIR}" FOLLOW_SYMLINK_CHAIN)
list(APPEND servertypes "${servertype}")
endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment