From eb20bd5ddf4d00a013da60fa091d5c3179f589c4 Mon Sep 17 00:00:00 2001 From: Nathan Wiebe Neufeldt Date: Wed, 18 Sep 2024 16:48:42 -0400 Subject: [PATCH] Add proper env hook for .sh shells Signed-off-by: Nathan Wiebe Neufeldt --- CMakeLists.txt | 5 +---- gz_common_vendor.sh.in | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 gz_common_vendor.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a6150b..d9395cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,10 +67,7 @@ ament_export_dependencies( if(NOT ${${LIB_NAME_FULL}_FOUND}) ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.dsv.in") - # Create a dummy .sh file needed for ament_package to source the .dsv file. - # See https://github.com/ament/ament_package/issues/145 - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.sh "# Dummy .sh file needed for .dsv file to be sourced.") - ament_environment_hooks("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.sh") + ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.sh.in") endif() # The goal is to support versionless package names once the user has found the diff --git a/gz_common_vendor.sh.in b/gz_common_vendor.sh.in new file mode 100644 index 0000000..4f0349e --- /dev/null +++ b/gz_common_vendor.sh.in @@ -0,0 +1,3 @@ +if [ -d "$AMENT_CURRENT_PREFIX/opt/@PROJECT_NAME@/share/gz" ]; then + ament_prepend_unique_value GZ_CONFIG_PATH "$AMENT_CURRENT_PREFIX/opt/@PROJECT_NAME@/share/gz" +fi