Skip to content
Snippets Groups Projects
Commit 9f712c11 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #10913: Fixed actual application of DESTINATION to target path

parent ac7f9cd9
No related branches found
No related tags found
No related merge requests found
...@@ -193,24 +193,25 @@ if(NOT DEFINED LOFAR_MACROS_INCLUDED) ...@@ -193,24 +193,25 @@ if(NOT DEFINED LOFAR_MACROS_INCLUDED)
# installs "etc/bar". # installs "etc/bar".
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
macro(lofar_add_sysconf_files) macro(lofar_add_sysconf_files)
string(REGEX REPLACE ";?DESTINATION.*" "" _srcs "${ARGN}") string(REGEX REPLACE ";?DESTINATION.*" "" _src_names "${ARGN}")
string(REGEX MATCH "DESTINATION;.*" _dest "${ARGN}") string(REGEX MATCH "DESTINATION;.*" _destination "${ARGN}")
string(REGEX REPLACE "^DESTINATION;" "" _dest "${_dest}") string(REGEX REPLACE "^DESTINATION;" "" _destination "${_destination}")
foreach(_src_name ${_srcs}) foreach(_src_name ${_src_names})
if(_dest MATCHES ".+") if(_destination MATCHES ".+")
get_filename_component(_dst_name ${_src_name} NAME) get_filename_component(_src_filename ${_src_name} NAME)
else(_dest MATCHES ".+") set(_dest_name ${_destination}/${_src_filename})
set(_dst_name ${_src_name}) else(_destination MATCHES ".+")
endif(_dest MATCHES ".+") set(_dest_name ${_src_name})
endif(_destination MATCHES ".+")
get_filename_component(_abs_name ${_src_name} ABSOLUTE) get_filename_component(_abs_name ${_src_name} ABSOLUTE)
get_filename_component(_dst_path ${_dst_name} PATH) get_filename_component(_dest_path ${_dest_name} PATH)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/etc/${_path}) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/etc/${_dest_path})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${_abs_name} ${CMAKE_BINARY_DIR}/etc/${_dst_name}) ${_abs_name} ${CMAKE_BINARY_DIR}/etc/${_dest_name})
install(FILES ${_src_name} DESTINATION etc/${_dst_path}) install(FILES ${_src_name} DESTINATION etc/${_dest_path})
endforeach(_src_name ${ARGN}) endforeach(_src_name ${_src_names})
endmacro(lofar_add_sysconf_files) endmacro(lofar_add_sysconf_files)
......
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