From 8e143c7da4ea1946d09f668265787722a840cc10 Mon Sep 17 00:00:00 2001 From: Paul Bovbel Date: Mon, 20 Aug 2018 12:51:07 -0400 Subject: [PATCH] Generate a manifest of env hooks for use by other build tools --- cmake/catkin_add_env_hooks.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/catkin_add_env_hooks.cmake b/cmake/catkin_add_env_hooks.cmake index dc063bd80..2e64269e5 100644 --- a/cmake/catkin_add_env_hooks.cmake +++ b/cmake/catkin_add_env_hooks.cmake @@ -96,6 +96,7 @@ 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/catkin_profile.${shell}.manifest) if(EXISTS ${base}.em OR EXISTS ${base}.installspace.em) # evaluate em template and install if(EXISTS ${base}.installspace.em) @@ -110,6 +111,7 @@ function(catkin_add_env_hooks file_prefix) if(NOT ${ARG_SKIP_INSTALL}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} DESTINATION etc/catkin/profile.d) + file(APPEND ${manifest} "${ENV_HOOK}\n") endif() elseif(EXISTS ${base}.in OR EXISTS ${base}.installspace.in) # evaluate in template and install @@ -124,6 +126,7 @@ function(catkin_add_env_hooks file_prefix) if(NOT ${ARG_SKIP_INSTALL}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} DESTINATION etc/catkin/profile.d) + file(APPEND ${manifest} "${ENV_HOOK}\n") endif() elseif (EXISTS ${base}) # install plain file @@ -132,6 +135,12 @@ function(catkin_add_env_hooks file_prefix) DESTINATION etc/catkin/profile.d) endif() endif() + + if(NOT ${ARG_SKIP_INSTALL} AND EXISTS ${manifest}) + install(FILES ${manifest} + DESTINATION etc/${PROJECT_NAME}) + endif() + endforeach() # refresh environment cache