Skip to content

Commit

Permalink
Fix CMake error when entire ament projects are added via add_subdirec…
Browse files Browse the repository at this point in the history
…tory (#484) (#487)

Signed-off-by: Silvio Traversaro <silvio.traversaro@iit.it>
(cherry picked from commit 53d31f3)

Co-authored-by: Silvio Traversaro <silvio@traversaro.it>
  • Loading branch information
mergify[bot] and traversaro committed Nov 29, 2023
1 parent 4248cdf commit 36a1ee4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function(ament_environment_hooks)
get_filename_component(hook_basename "${hook}" NAME_WE)
if(DEFINED AMENT_CMAKE_ENVIRONMENT_HOOKS_DESC_${hook_basename})
# write .dsv file containing the descriptor of the environment hook
set(dsv_file "${CMAKE_BINARY_DIR}/ament_cmake_environment_hooks/${hook_basename}.dsv")
set(dsv_file "${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_environment_hooks/${hook_basename}.dsv")
file(GENERATE OUTPUT "${dsv_file}" CONTENT "${AMENT_CMAKE_ENVIRONMENT_HOOKS_DESC_${hook_basename}}\n")
install(
FILES "${dsv_file}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function(ament_generate_package_environment)
endforeach()
endif()
list(APPEND all_package_level_extensions "dsv")
set(dsv_file "${CMAKE_BINARY_DIR}/ament_cmake_environment_hooks/local_setup.dsv")
set(dsv_file "${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_environment_hooks/local_setup.dsv")
file(GENERATE OUTPUT "${dsv_file}" CONTENT "${all_hooks}")
install(
FILES "${dsv_file}"
Expand All @@ -111,7 +111,7 @@ function(ament_generate_package_environment)

# generate package.dsv file
list(SORT all_package_level_extensions)
set(dsv_file "${CMAKE_BINARY_DIR}/ament_cmake_environment_hooks/package.dsv")
set(dsv_file "${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_environment_hooks/package.dsv")
set(dsv_content "")
foreach(ext ${all_package_level_extensions})
set(dsv_content "${dsv_content}source;share/${PROJECT_NAME}/local_setup.${ext}\n")
Expand Down

0 comments on commit 36a1ee4

Please sign in to comment.