Skip to content

Commit fde430c

Browse files
Add DEPENDS_EXPLICIT_ONLY to remove implicit dependencies (#238)
* Add DEPENDS_EXPLICIT_ONLY to remove implicit dependencies Signed-off-by: Anthony Welte <tony.welte@gmail.com> * Use version check instead of bumping minimum cmake version Signed-off-by: Anthony Welte <tony.welte@gmail.com> --------- Signed-off-by: Anthony Welte <tony.welte@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 9840fc2 commit fde430c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

rosidl_generator_py/cmake/custom_command.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
# CMake does not allow `add_custom_command()` to depend on files generated in
1919
# a different CMake subdirectory, and this command is invoked after an
2020
# add_subdirectory() call.
21+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.27)
22+
set(_dep_explicit_only DEPENDS_EXPLICIT_ONLY)
23+
else()
24+
set(_dep_explicit_only "")
25+
endif()
26+
2127
add_custom_command(
2228
OUTPUT ${_generated_extension_files} ${_generated_py_files} ${_generated_c_files}
2329
# This assumes that python_cmake_module was found, which is always the case since this is only
@@ -28,6 +34,7 @@ add_custom_command(
2834
DEPENDS ${target_dependencies} ${rosidl_generate_interfaces_TARGET}
2935
COMMENT "Generating Python code for ROS interfaces"
3036
VERBATIM
37+
${_dep_explicit_only}
3138
)
3239

3340
if(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix})

0 commit comments

Comments
 (0)