Description
The three exported CMake macros use hardcoded relative paths from CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR to locate scripts and resources:
| Macro |
Relative paths used |
autoware_system_designer_build_deploy.cmake |
${CMAKE_BINARY_DIR}/../autoware_system_designer/script/deployment_process.py, system_designer_runner.py, resource/; ${CMAKE_SOURCE_DIR}/../autoware_system_designer as PYTHONPATH |
autoware_system_designer_generate_launcher.cmake |
${CMAKE_BINARY_DIR}/../autoware_system_designer/script/generate_node_launcher.py, system_designer_runner.py |
autoware_system_designer_parameter.cmake |
${CMAKE_BINARY_DIR}/../autoware_system_designer/script/parameter_process.py, system_designer_runner.py |
This assumes the autoware_system_designer source and build trees coexist as siblings of the consuming package at build time. This breaks when:
- Staged Docker builds clean build artifacts between stages (e.g., via
build_and_clean.sh), so the build directory no longer exists when a downstream package tries to use the macro
- The package is pre-installed (e.g., from a debian/apt package)
- Someone builds with
--packages-select <consumer> without autoware_system_designer in the same workspace
Suggested fix
Install the scripts to the package's share directory, then derive the path in the -extras.cmake from the installed find_package result. For example:
# In CMakeLists.txt - install scripts
install(DIRECTORY script/ DESTINATION share/${PROJECT_NAME}/script)
# In the exported cmake macros
set(SYSTEM_DESIGNER_RUNNER_SCRIPT "${autoware_system_designer_DIR}/../../share/autoware_system_designer/script/system_designer_runner.py")
This works from both the colcon workspace build and the install space.
🎗️ In summary, the constraint is that Package A is not allowed to require the build folder of the dependency Package B.
Context
Description
The three exported CMake macros use hardcoded relative paths from
CMAKE_BINARY_DIRandCMAKE_SOURCE_DIRto locate scripts and resources:autoware_system_designer_build_deploy.cmake${CMAKE_BINARY_DIR}/../autoware_system_designer/script/deployment_process.py,system_designer_runner.py,resource/;${CMAKE_SOURCE_DIR}/../autoware_system_designeras PYTHONPATHautoware_system_designer_generate_launcher.cmake${CMAKE_BINARY_DIR}/../autoware_system_designer/script/generate_node_launcher.py,system_designer_runner.pyautoware_system_designer_parameter.cmake${CMAKE_BINARY_DIR}/../autoware_system_designer/script/parameter_process.py,system_designer_runner.pyThis assumes the
autoware_system_designersource and build trees coexist as siblings of the consuming package at build time. This breaks when:build_and_clean.sh), so the build directory no longer exists when a downstream package tries to use the macro--packages-select <consumer>withoutautoware_system_designerin the same workspaceSuggested fix
Install the scripts to the package's share directory, then derive the path in the
-extras.cmakefrom the installedfind_packageresult. For example:This works from both the colcon workspace build and the install space.
🎗️ In summary, the constraint is that Package A is not allowed to require the build folder of the dependency Package B.
Context
autoware_system_designerto the Autoware Docker build