Skip to content

Commit

Permalink
Install hooks to share/project_name/profile.d
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbovbel committed Aug 28, 2018
1 parent 5734a04 commit 4708365
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cmake/catkin_add_env_hooks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -126,22 +126,18 @@ 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
Expand Down

0 comments on commit 4708365

Please sign in to comment.