diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index ee8503a4..44dad5f5 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -26,6 +26,13 @@ endif() project(fastdds_python VERSION 2.4.0) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + # Set BUILD_TESTING to OFF by default. if(NOT BUILD_TESTING) message(STATUS "Tests not compiled by default") diff --git a/fastdds_python/test/types/CMakeLists.txt b/fastdds_python/test/types/CMakeLists.txt index 3809a1be..12ad5204 100644 --- a/fastdds_python/test/types/CMakeLists.txt +++ b/fastdds_python/test/types/CMakeLists.txt @@ -41,6 +41,13 @@ find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_included_modulesTypeObjectSupport.cxx @@ -146,6 +153,13 @@ find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_modulesTypeObjectSupport.cxx @@ -251,6 +265,13 @@ find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_completeTypeObjectSupport.cxx diff --git a/fastdds_python/test/types/test_complete.i b/fastdds_python/test/types/test_complete.i index accb8723..80daaa60 100644 --- a/fastdds_python/test/types/test_complete.i +++ b/fastdds_python/test/types/test_complete.i @@ -233,6 +233,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } @@ -444,6 +449,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } @@ -1699,6 +1709,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } diff --git a/fastdds_python/test/types/test_modules.i b/fastdds_python/test/types/test_modules.i index 5b4c32a0..ce8a42ad 100644 --- a/fastdds_python/test/types/test_modules.i +++ b/fastdds_python/test/types/test_modules.i @@ -232,6 +232,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } @@ -432,6 +437,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } @@ -1687,6 +1697,11 @@ namespace swig { eprosima::fastcdr::fixed_string<16> tmp(value); $self->fixed_string_field(tmp); } + + std::string fixed_string_field_str() const + { + return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16)); + } } diff --git a/fastdds_python_examples/HelloWorldExample/generated_code/CMakeLists.txt b/fastdds_python_examples/HelloWorldExample/generated_code/CMakeLists.txt index ead5e629..1e857efb 100644 --- a/fastdds_python_examples/HelloWorldExample/generated_code/CMakeLists.txt +++ b/fastdds_python_examples/HelloWorldExample/generated_code/CMakeLists.txt @@ -41,6 +41,13 @@ find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED HelloWorldTypeObjectSupport.cxx diff --git a/fastdds_python_examples/RPCExample/generated_code/CMakeLists.txt b/fastdds_python_examples/RPCExample/generated_code/CMakeLists.txt index 79382f18..d00b75e0 100644 --- a/fastdds_python_examples/RPCExample/generated_code/CMakeLists.txt +++ b/fastdds_python_examples/RPCExample/generated_code/CMakeLists.txt @@ -41,6 +41,13 @@ find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED calculatorTypeObjectSupport.cxx