From b298c8a6f638e7bad991004b7c483ad0bbe47639 Mon Sep 17 00:00:00 2001 From: Paul Bovbel Date: Tue, 28 Aug 2018 10:24:00 -0400 Subject: [PATCH] Install hooks to share/project_name/profile.d --- cmake/catkin_add_env_hooks.cmake | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cmake/catkin_add_env_hooks.cmake b/cmake/catkin_add_env_hooks.cmake index 354e86ef1..1caef5efa 100644 --- a/cmake/catkin_add_env_hooks.cmake +++ b/cmake/catkin_add_env_hooks.cmake @@ -96,7 +96,6 @@ function(catkin_add_env_hooks file_prefix) # generate and install environment hook for installspace set(DEVELSPACE False) set(INSTALLSPACE True) - set(manifest ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/profile.${shell}.manifest) if(EXISTS ${base}.em OR EXISTS ${base}.installspace.em) # evaluate em template and install if(EXISTS ${base}.installspace.em) @@ -111,7 +110,8 @@ function(catkin_add_env_hooks file_prefix) if(NOT ${ARG_SKIP_INSTALL}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} DESTINATION ${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d) - file(APPEND ${manifest} "${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d/${ENV_HOOK}\n") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} + DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/profile.d) endif() elseif(EXISTS ${base}.in OR EXISTS ${base}.installspace.in) # evaluate in template and install @@ -126,22 +126,19 @@ function(catkin_add_env_hooks file_prefix) if(NOT ${ARG_SKIP_INSTALL}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} DESTINATION ${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d) - file(APPEND ${manifest} "${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d/${ENV_HOOK}\n") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} + DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/profile.d) endif() elseif (EXISTS ${base}) # install plain file if(NOT ${ARG_SKIP_INSTALL}) install(FILES ${base} DESTINATION ${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d) - file(APPEND ${manifest} "${CATKIN_GLOBAL_ETC_DESTINATION}/catkin/profile.d/${ENV_HOOK}\n") + install(FILES ${base} + DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/profile.d) endif() endif() - if(NOT ${ARG_SKIP_INSTALL} AND EXISTS ${manifest}) - install(FILES ${manifest} - DESTINATION ${CATKIN_GLOBAL_ETC_DESTINATION}/${PROJECT_NAME}) - endif() - endforeach() # refresh environment cache