File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
rosidl_typesupport_fastrtps_cpp/cmake
rosidl_typesupport_fastrtps_c/cmake Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,18 @@ 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.27) # Required by option DEPENDS_EXPLICIT_ONLY of add_custom_command
91+ cmake_minimum_required (VERSION 3.20)
9292cmake_policy (SET CMP0094 NEW)
9393set (Python3_FIND_UNVERSIONED_NAMES FIRST)
9494
9595find_package (Python3 REQUIRED COMPONENTS Interpreter)
9696
97+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.27)
98+ set (_dep_explicit_only DEPENDS_EXPLICIT_ONLY)
99+ else ()
100+ set (_dep_explicit_only "" )
101+ endif ()
102+
97103add_custom_command (
98104 OUTPUT ${_generated_files}
99105 COMMAND Python3::Interpreter
@@ -102,7 +108,7 @@ add_custom_command(
102108 DEPENDS ${target_dependencies}
103109 COMMENT "Generating C type support for eProsima Fast-RTPS"
104110 VERBATIM
105- DEPENDS_EXPLICIT_ONLY
111+ ${_dep_explicit_only}
106112)
107113
108114# generate header to switch between export and import for a specific package
Original file line number Diff line number Diff line change @@ -98,12 +98,18 @@ rosidl_write_generator_arguments(
9898# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
9999# latter functionality is only available in CMake 3.20 or later, so we need
100100# at least that version.
101- cmake_minimum_required (VERSION 3.27) # Required by option DEPENDS_EXPLICIT_ONLY of add_custom_command
101+ cmake_minimum_required (VERSION 3.20)
102102cmake_policy (SET CMP0094 NEW)
103103set (Python3_FIND_UNVERSIONED_NAMES FIRST)
104104
105105find_package (Python3 REQUIRED COMPONENTS Interpreter)
106106
107+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.27)
108+ set (_dep_explicit_only DEPENDS_EXPLICIT_ONLY)
109+ else ()
110+ set (_dep_explicit_only "" )
111+ endif ()
112+
107113# Add a command that invokes generator at build time
108114add_custom_command (
109115 OUTPUT ${_generated_files}
@@ -113,7 +119,7 @@ add_custom_command(
113119 DEPENDS ${target_dependencies}
114120 COMMENT "Generating C++ type support for eProsima Fast-RTPS"
115121 VERBATIM
116- DEPENDS_EXPLICIT_ONLY
122+ ${_dep_explicit_only}
117123)
118124
119125# generate header to switch between export and import for a specific package
You can’t perform that action at this time.
0 commit comments