diff --git a/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c_generate_interfaces.cmake b/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c_generate_interfaces.cmake index 49085fb..d6cac86 100644 --- a/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c_generate_interfaces.cmake +++ b/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c_generate_interfaces.cmake @@ -94,6 +94,12 @@ set(Python3_FIND_UNVERSIONED_NAMES FIRST) find_package(Python3 REQUIRED COMPONENTS Interpreter) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.27) + set(_dep_explicit_only DEPENDS_EXPLICIT_ONLY) +else() + set(_dep_explicit_only "") +endif() + add_custom_command( OUTPUT ${_generated_files} COMMAND Python3::Interpreter @@ -102,6 +108,7 @@ add_custom_command( DEPENDS ${target_dependencies} COMMENT "Generating C type support for eProsima Fast-RTPS" VERBATIM + ${_dep_explicit_only} ) # generate header to switch between export and import for a specific package diff --git a/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake b/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake index af089a3..a2086bd 100644 --- a/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake +++ b/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake @@ -104,6 +104,12 @@ set(Python3_FIND_UNVERSIONED_NAMES FIRST) find_package(Python3 REQUIRED COMPONENTS Interpreter) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.27) + set(_dep_explicit_only DEPENDS_EXPLICIT_ONLY) +else() + set(_dep_explicit_only "") +endif() + # Add a command that invokes generator at build time add_custom_command( OUTPUT ${_generated_files} @@ -113,6 +119,7 @@ add_custom_command( DEPENDS ${target_dependencies} COMMENT "Generating C++ type support for eProsima Fast-RTPS" VERBATIM + ${_dep_explicit_only} ) # generate header to switch between export and import for a specific package