Index: ament_cmake_core/cmake/core/python.cmake =================================================================== --- ament_cmake_core.orig/cmake/core/python.cmake +++ ament_cmake_core/cmake/core/python.cmake @@ -17,6 +17,10 @@ # Example: # find_package(Python3 3.8 REQUIRED) # find_package(ament_cmake REQUIRED) + +if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo) + set(Python3_FIND_UNVERSIONED_NAMES FIRST) +endif() if(NOT TARGET Python3::Interpreter) find_package(Python3 REQUIRED COMPONENTS Interpreter) endif()