Skip to content

Commit 11f6223

Browse files
committed
Add DEPENDS_EXPLICIT_ONLY to remove implicit dependencies
1 parent 04bd000 commit 11f6223

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

rosidl_generator_type_description/cmake/rosidl_generator_type_description_generate_interfaces.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
2525
# latter functionality is only available in CMake 3.20 or later, so we need
2626
# at least that version.
27-
cmake_minimum_required(VERSION 3.20)
27+
cmake_minimum_required(VERSION 3.27) # Required by option DEPENDS_EXPLICIT_ONLY of add_custom_command
2828
cmake_policy(SET CMP0094 NEW)
2929
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
3030

@@ -88,6 +88,7 @@ add_custom_command(
8888
DEPENDS ${target_dependencies}
8989
COMMENT "Generating type hashes for ROS interfaces"
9090
VERBATIM
91+
DEPENDS_EXPLICIT_ONLY
9192
)
9293

9394
set(_target "${rosidl_generate_interfaces_TARGET}__rosidl_generator_type_description")

rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_c_generate_interfaces.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ rosidl_write_generator_arguments(
8888
# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
8989
# latter functionality is only available in CMake 3.20 or later, so we need
9090
# at least that version.
91-
cmake_minimum_required(VERSION 3.20)
91+
cmake_minimum_required(VERSION 3.27) # Required by option DEPENDS_EXPLICIT_ONLY of add_custom_command
9292
cmake_policy(SET CMP0094 NEW)
9393
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
9494

@@ -102,6 +102,7 @@ add_custom_command(
102102
DEPENDS ${target_dependencies}
103103
COMMENT "Generating C introspection for ROS interfaces"
104104
VERBATIM
105+
DEPENDS_EXPLICIT_ONLY
105106
)
106107

107108
# generate header to switch between export and import for a specific package

rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ rosidl_write_generator_arguments(
8888
# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
8989
# latter functionality is only available in CMake 3.20 or later, so we need
9090
# at least that version.
91-
cmake_minimum_required(VERSION 3.20)
91+
cmake_minimum_required(VERSION 3.27) # Required by option DEPENDS_EXPLICIT_ONLY of add_custom_command
9292
cmake_policy(SET CMP0094 NEW)
9393
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
9494

@@ -102,6 +102,7 @@ add_custom_command(
102102
DEPENDS ${target_dependencies}
103103
COMMENT "Generating C++ introspection for ROS interfaces"
104104
VERBATIM
105+
DEPENDS_EXPLICIT_ONLY
105106
)
106107

107108
set(_target_suffix "__rosidl_typesupport_introspection_cpp")

0 commit comments

Comments
 (0)