Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(POLICY CMP0086)
cmake_policy(SET CMP0086 NEW)
endif()

project(FastDdsPythonWrapper)
project(fastdds_python VERSION 0.2.0)

###############################################################################
# Dependencies
Expand Down
21 changes: 21 additions & 0 deletions fastdds_python/cmake/packaging/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@)

@PACKAGE_INIT@

set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")

include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)
37 changes: 35 additions & 2 deletions fastdds_python/src/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ message(STATUS "Configuring FastDDS wrapper for Python...")

find_package (PythonInterp REQUIRED)

set(LIB_INSTALL_DIR lib/ CACHE PATH "Installation directory for libraries")

set(${PROJECT_NAME}_MODULE
fastdds
)
Expand All @@ -36,7 +38,12 @@ SET_SOURCE_FILES_PROPERTIES(

INCLUDE_DIRECTORIES()

SWIG_ADD_LIBRARY(${PROJECT_NAME}
option(BUILD_DOCUMENTATION "Use doxygen to create product documentation" OFF)
if (BUILD_DOCUMENTATION)
set(CMAKE_SWIG_FLAGS "-doxygen")
endif (BUILD_DOCUMENTATION)

SWIG_ADD_LIBRARY(${PROJECT_NAME}
TYPE SHARED
LANGUAGE python
SOURCES ${${PROJECT_NAME}_FILES}
Expand All @@ -59,6 +66,32 @@ SET (PYTHON_MODULE_PATH
)

# Install
install(TARGETS ${PROJECT_NAME} DESTINATION ${PYTHON_MODULE_PATH})
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
DESTINATION ${PYTHON_MODULE_PATH}
)
get_property(support_files TARGET ${PROJECT_NAME} PROPERTY SWIG_SUPPORT_FILES)
install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH})

export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-targets.cmake)

install(EXPORT ${PROJECT_NAME}-targets
DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}/
)

# Create CMake config file.
include(CMakePackageConfigHelpers)

configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/packaging/Config.cmake.in
${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}
PATH_VARS LIB_INSTALL_DIR
)
write_basic_package_version_file(${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES ${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config.cmake
${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config-version.cmake
DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}
)
20 changes: 10 additions & 10 deletions fastdds_python/src/swig/fastdds.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
%module(directors="1", threads="1") fastdds

// SWIG helper modules
%include "stdint.i"
%include "std_string.i"
%include "typemaps.i"
%include "std_shared_ptr.i"
Expand All @@ -30,11 +31,6 @@
// and make not difference in python anyways
#define final

// Definition of internal types
typedef int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;

// Macro delcarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
Expand Down Expand Up @@ -72,7 +68,6 @@ namespace builtin {
%include "fastrtps/utils/collections/ResourceLimitedVector.i"

/*
%include "fastdds/rtps/common/Property.i"
%include "fastdds/rtps/common/FragmentNumber.i"
%include "fastdds/rtps/common/LocatorSelector.i"
%include "fastdds/rtps/common/LocatorSelectorEntry.i"
Expand All @@ -89,7 +84,6 @@ namespace builtin {
%include "fastdds/rtps/common/SequenceNumber.i"
%include "fastdds/rtps/common/RemoteLocators.i"
%include "fastdds/rtps/common/WriteParams.i"
%include "fastdds/rtps/common/BinaryProperty.i"

%include "fastrtps/rtps/common/SerializedPayload.i"
%include "fastrtps/rtps/common/Time_t.i"
Expand Down Expand Up @@ -139,7 +133,6 @@ namespace builtin {
%include "fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.i"
%include "fastdds/rtps/attributes/WriterAttributes.i"
%include "fastdds/rtps/attributes/ServerAttributes.i"
%include "fastdds/rtps/attributes/PropertyPolicy.i"
%include "fastdds/rtps/reader/ReaderDiscoveryInfo.i"
%include "fastdds/rtps/reader/StatelessReader.i"
%include "fastdds/rtps/reader/StatefulReader.i"
Expand Down Expand Up @@ -365,10 +358,17 @@ namespace builtin {
%include "fastrtps/Domain.i"
*/

%include "fastdds/dds/core/status/StatusMask.i"
%include "fastdds/rtps/common/EntityId_t.i"
%include "fastdds/rtps/common/GuidPrefix_t.i"
%include "fastdds/rtps/common/Guid.i"

/*
%include "fastdds/rtps/common/BinaryProperty.i"
%include "fastdds/rtps/common/Property.i"
%include "fastdds/rtps/attributes/PropertyPolicy.i"
*/

%include "fastdds/dds/core/status/StatusMask.i"
%include "fastdds/dds/common/InstanceHandle.i"
%include "fastdds/dds/core/policy/ParameterTypes.i"
%include "fastdds/dds/core/policy/QosPolicies.i"
Expand Down Expand Up @@ -426,7 +426,7 @@ namespace builtin {
%include "fastdds/dds/domain/DomainParticipant.i"
%include "fastdds/dds/domain/DomainParticipantFactory.i"

// Log functionality not available in the bind
// Log functionality not available in the bind
// Logs in the library is still available, only 'Log' class will not be available on Python
/*
%include "fastdds/dds/log/Log.i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
#include "fastdds/rtps/attributes/PropertyPolicy.h"
%}

// Ignore overloaded constructor that have no effect on target language
%ignore eprosima::fastrtps::rtps::PropertyPolicy::PropertyPolicy(PropertyPolicy &&);
%ignore eprosima::fastrtps::rtps::PropertyPolicyHelper;

%include "fastdds/rtps/attributes/PropertyPolicy.h"
5 changes: 5 additions & 0 deletions fastdds_python/src/swig/fastdds/rtps/common/BinaryProperty.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@
#include "fastdds/rtps/common/BinaryProperty.h"
%}

// Ignore overloaded constructor that have no effect on target language
%ignore eprosima::fastrtps::rtps::BinaryProperty::BinaryProperty(BinaryProperty &&);
%ignore eprosima::fastrtps::rtps::BinaryProperty::value(std::vector<uint8_t> &&);
%ignore eprosima::fastrtps::rtps::BinaryProperty::propagate();

%include "fastdds/rtps/common/BinaryProperty.h"
4 changes: 4 additions & 0 deletions fastdds_python/src/swig/fastdds/rtps/common/Property.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
#include "fastdds/rtps/common/Property.h"
%}

// Ignore overloaded constructor that have no effect on target language
%ignore eprosima::fastrtps::rtps::Property::Property(Property &&);
%ignore eprosima::fastrtps::rtps::Property::propagate();

%include "fastdds/rtps/common/Property.h"