diff --git a/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg b/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg index 644720de..ffa880c8 100644 --- a/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg +++ b/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg @@ -71,7 +71,12 @@ target_link_libraries(\${PROJECT_NAME} ############################################################################### # Python bindings for type -find_package(SWIG REQUIRED) +find_package(SWIG) +if (NOT SWIG_FOUND) + # Trick to find swig4.1 in Ubuntu noble. + find_program(SWIG_EXECUTABLE NAMES swig4.1 swig) + find_package(SWIG REQUIRED) +endif() include(\${SWIG_USE_FILE}) set(CMAKE_SWIG_FLAGS "")