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(
88
88
# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
89
89
# latter functionality is only available in CMake 3.20 or later, so we need
90
90
# 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)
92
92
cmake_policy (SET CMP0094 NEW)
93
93
set (Python3_FIND_UNVERSIONED_NAMES FIRST)
94
94
95
95
find_package (Python3 REQUIRED COMPONENTS Interpreter)
96
96
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
+
97
103
add_custom_command (
98
104
OUTPUT ${_generated_files}
99
105
COMMAND Python3::Interpreter
@@ -102,7 +108,7 @@ add_custom_command(
102
108
DEPENDS ${target_dependencies}
103
109
COMMENT "Generating C type support for eProsima Fast-RTPS"
104
110
VERBATIM
105
- DEPENDS_EXPLICIT_ONLY
111
+ ${_dep_explicit_only}
106
112
)
107
113
108
114
# 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(
98
98
# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
99
99
# latter functionality is only available in CMake 3.20 or later, so we need
100
100
# 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)
102
102
cmake_policy (SET CMP0094 NEW)
103
103
set (Python3_FIND_UNVERSIONED_NAMES FIRST)
104
104
105
105
find_package (Python3 REQUIRED COMPONENTS Interpreter)
106
106
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
+
107
113
# Add a command that invokes generator at build time
108
114
add_custom_command (
109
115
OUTPUT ${_generated_files}
@@ -113,7 +119,7 @@ add_custom_command(
113
119
DEPENDS ${target_dependencies}
114
120
COMMENT "Generating C++ type support for eProsima Fast-RTPS"
115
121
VERBATIM
116
- DEPENDS_EXPLICIT_ONLY
122
+ ${_dep_explicit_only}
117
123
)
118
124
119
125
# generate header to switch between export and import for a specific package
You can’t perform that action at this time.
0 commit comments