File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,16 @@ ${_xacro_err}")
77
77
78
78
separate_arguments (_xacro_deps_result )
79
79
80
+ ## HACK: ament package resolution doesn't work at build time yet
81
+ # - Augment AMENT_PREFIX_PATH to include ${PROJECT_BINARY_DIR}/ament_cmake_index
82
+ # - Create a symlink from there to the actual source directory to find source files
83
+ set (PROJECT_BUILD_INDEX "${PROJECT_BINARY_DIR} /ament_cmake_index" )
84
+ execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_BUILD_INDEX} /share" )
85
+ execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink "${PROJECT_SOURCE_DIR} " "${PROJECT_BUILD_INDEX} /share/${PROJECT_NAME} " )
86
+
80
87
## command to actually call xacro
81
88
add_custom_command (OUTPUT ${output}
82
- COMMAND xacro -o ${abs_output} ${input} ${_XACRO_REMAP}
89
+ COMMAND ${CMAKE_COMMAND} -E env AMENT_PREFIX_PATH= " ${PROJECT_BUILD_INDEX} : ${AMENT_PREFIX_PATH} " xacro -o ${abs_output} ${input} ${_XACRO_REMAP}
83
90
DEPENDS ${input} ${_xacro_deps_result} ${_XACRO_DEPENDS}
84
91
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
85
92
COMMENT "xacro: generating ${output} from ${input} "
You can’t perform that action at this time.
0 commit comments