Skip to content

Commit

Permalink
Generate a manifest of env hooks for use by other build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbovbel committed Aug 23, 2018
1 parent 5d86839 commit 8e143c7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmake/catkin_add_env_hooks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8e143c7

Please sign in to comment.