Skip to content

Commit 3b88247

Browse files
authored
Refs #13380. Add doxygen doc generation (#6)
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent e85530b commit 3b88247

7 files changed

Lines changed: 80 additions & 13 deletions

File tree

fastdds_python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(POLICY CMP0086)
2424
cmake_policy(SET CMP0086 NEW)
2525
endif()
2626

27-
project(FastDdsPythonWrapper)
27+
project(fastdds_python VERSION 0.2.0)
2828

2929
###############################################################################
3030
# Dependencies
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@)
16+
17+
@PACKAGE_INIT@
18+
19+
set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
20+
21+
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)

fastdds_python/src/swig/CMakeLists.txt

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ message(STATUS "Configuring FastDDS wrapper for Python...")
2020

2121
find_package (PythonInterp REQUIRED)
2222

23+
set(LIB_INSTALL_DIR lib/ CACHE PATH "Installation directory for libraries")
24+
2325
set(${PROJECT_NAME}_MODULE
2426
fastdds
2527
)
@@ -36,7 +38,12 @@ SET_SOURCE_FILES_PROPERTIES(
3638

3739
INCLUDE_DIRECTORIES()
3840

39-
SWIG_ADD_LIBRARY(${PROJECT_NAME}
41+
option(BUILD_DOCUMENTATION "Use doxygen to create product documentation" OFF)
42+
if (BUILD_DOCUMENTATION)
43+
set(CMAKE_SWIG_FLAGS "-doxygen")
44+
endif (BUILD_DOCUMENTATION)
45+
46+
SWIG_ADD_LIBRARY(${PROJECT_NAME}
4047
TYPE SHARED
4148
LANGUAGE python
4249
SOURCES ${${PROJECT_NAME}_FILES}
@@ -59,6 +66,32 @@ SET (PYTHON_MODULE_PATH
5966
)
6067

6168
# Install
62-
install(TARGETS ${PROJECT_NAME} DESTINATION ${PYTHON_MODULE_PATH})
69+
install(TARGETS ${PROJECT_NAME}
70+
EXPORT ${PROJECT_NAME}-targets
71+
DESTINATION ${PYTHON_MODULE_PATH}
72+
)
6373
get_property(support_files TARGET ${PROJECT_NAME} PROPERTY SWIG_SUPPORT_FILES)
6474
install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH})
75+
76+
export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-targets.cmake)
77+
78+
install(EXPORT ${PROJECT_NAME}-targets
79+
DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}/
80+
)
81+
82+
# Create CMake config file.
83+
include(CMakePackageConfigHelpers)
84+
85+
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/packaging/Config.cmake.in
86+
${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config.cmake
87+
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}
88+
PATH_VARS LIB_INSTALL_DIR
89+
)
90+
write_basic_package_version_file(${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config-version.cmake
91+
VERSION ${PROJECT_VERSION}
92+
COMPATIBILITY SameMajorVersion
93+
)
94+
install(FILES ${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config.cmake
95+
${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config-version.cmake
96+
DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}
97+
)

fastdds_python/src/swig/fastdds.i

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
%module(directors="1", threads="1") fastdds
1616

1717
// SWIG helper modules
18+
%include "stdint.i"
1819
%include "std_string.i"
1920
%include "typemaps.i"
2021
%include "std_shared_ptr.i"
@@ -30,11 +31,6 @@
3031
// and make not difference in python anyways
3132
#define final
3233

33-
// Definition of internal types
34-
typedef int int32_t;
35-
typedef unsigned int uint32_t;
36-
typedef unsigned int size_t;
37-
3834
// Macro delcarations
3935
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
4036
#define RTPS_DllAPI
@@ -72,7 +68,6 @@ namespace builtin {
7268
%include "fastrtps/utils/collections/ResourceLimitedVector.i"
7369

7470
/*
75-
%include "fastdds/rtps/common/Property.i"
7671
%include "fastdds/rtps/common/FragmentNumber.i"
7772
%include "fastdds/rtps/common/LocatorSelector.i"
7873
%include "fastdds/rtps/common/LocatorSelectorEntry.i"
@@ -89,7 +84,6 @@ namespace builtin {
8984
%include "fastdds/rtps/common/SequenceNumber.i"
9085
%include "fastdds/rtps/common/RemoteLocators.i"
9186
%include "fastdds/rtps/common/WriteParams.i"
92-
%include "fastdds/rtps/common/BinaryProperty.i"
9387
9488
%include "fastrtps/rtps/common/SerializedPayload.i"
9589
%include "fastrtps/rtps/common/Time_t.i"
@@ -139,7 +133,6 @@ namespace builtin {
139133
%include "fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.i"
140134
%include "fastdds/rtps/attributes/WriterAttributes.i"
141135
%include "fastdds/rtps/attributes/ServerAttributes.i"
142-
%include "fastdds/rtps/attributes/PropertyPolicy.i"
143136
%include "fastdds/rtps/reader/ReaderDiscoveryInfo.i"
144137
%include "fastdds/rtps/reader/StatelessReader.i"
145138
%include "fastdds/rtps/reader/StatefulReader.i"
@@ -365,10 +358,17 @@ namespace builtin {
365358
%include "fastrtps/Domain.i"
366359
*/
367360

368-
%include "fastdds/dds/core/status/StatusMask.i"
369361
%include "fastdds/rtps/common/EntityId_t.i"
370362
%include "fastdds/rtps/common/GuidPrefix_t.i"
371363
%include "fastdds/rtps/common/Guid.i"
364+
365+
/*
366+
%include "fastdds/rtps/common/BinaryProperty.i"
367+
%include "fastdds/rtps/common/Property.i"
368+
%include "fastdds/rtps/attributes/PropertyPolicy.i"
369+
*/
370+
371+
%include "fastdds/dds/core/status/StatusMask.i"
372372
%include "fastdds/dds/common/InstanceHandle.i"
373373
%include "fastdds/dds/core/policy/ParameterTypes.i"
374374
%include "fastdds/dds/core/policy/QosPolicies.i"
@@ -426,7 +426,7 @@ namespace builtin {
426426
%include "fastdds/dds/domain/DomainParticipant.i"
427427
%include "fastdds/dds/domain/DomainParticipantFactory.i"
428428

429-
// Log functionality not available in the bind
429+
// Log functionality not available in the bind
430430
// Logs in the library is still available, only 'Log' class will not be available on Python
431431
/*
432432
%include "fastdds/dds/log/Log.i"

fastdds_python/src/swig/fastdds/rtps/attributes/PropertyPolicy.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
#include "fastdds/rtps/attributes/PropertyPolicy.h"
1717
%}
1818

19+
// Ignore overloaded constructor that have no effect on target language
20+
%ignore eprosima::fastrtps::rtps::PropertyPolicy::PropertyPolicy(PropertyPolicy &&);
21+
%ignore eprosima::fastrtps::rtps::PropertyPolicyHelper;
22+
1923
%include "fastdds/rtps/attributes/PropertyPolicy.h"

fastdds_python/src/swig/fastdds/rtps/common/BinaryProperty.i

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
#include "fastdds/rtps/common/BinaryProperty.h"
1717
%}
1818

19+
// Ignore overloaded constructor that have no effect on target language
20+
%ignore eprosima::fastrtps::rtps::BinaryProperty::BinaryProperty(BinaryProperty &&);
21+
%ignore eprosima::fastrtps::rtps::BinaryProperty::value(std::vector<uint8_t> &&);
22+
%ignore eprosima::fastrtps::rtps::BinaryProperty::propagate();
23+
1924
%include "fastdds/rtps/common/BinaryProperty.h"

fastdds_python/src/swig/fastdds/rtps/common/Property.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
#include "fastdds/rtps/common/Property.h"
1717
%}
1818

19+
// Ignore overloaded constructor that have no effect on target language
20+
%ignore eprosima::fastrtps::rtps::Property::Property(Property &&);
21+
%ignore eprosima::fastrtps::rtps::Property::propagate();
22+
1923
%include "fastdds/rtps/common/Property.h"

0 commit comments

Comments
 (0)