Skip to content

Commit 6fd467d

Browse files
committed
Generate doxygen XML and enable docstrings
1 parent a64e2a7 commit 6fd467d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/scripts/python_wheels/cibw_before_all.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export PYTHON="python${PYTHON_VERSION}"
1414

1515
if [ "$(uname)" == "Linux" ]; then
1616
# manylinux2014 is based on CentOS 7, so use yum to install dependencies
17-
yum install -y wget
17+
yum install -y wget doxygen
1818

1919
# Install Boost from source
2020
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz --quiet
@@ -50,12 +50,14 @@ cmake $PROJECT_DIR \
5050
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
5151
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
5252
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
53-
-DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install
53+
-DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install \
54+
-DGTSAM_GENERATE_DOC_XML=1
5455

55-
cd $PROJECT_DIR/build/python
56-
echo | gcc -E -dM - | grep __GNUC__
56+
# Generate Doxygen XML documentation
57+
doxygen build/doc/Doxyfile
5758

5859
# Install the Python wrapper module and generate Python stubs
60+
cd $PROJECT_DIR/build/python
5961
if [ "$(uname)" == "Linux" ]; then
6062
make -j $(nproc) install
6163
make -j $(nproc) python-stubs

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ if(GTSAM_BUILD_PYTHON OR GTSAM_INSTALL_MATLAB_TOOLBOX)
124124
# Set the include directory for matlab.h
125125
set(GTWRAP_INCLUDE_NAME "wrap")
126126

127+
if (GTSAM_GENERATE_DOC_XML)
128+
set(GTWRAP_ADD_DOCSTRINGS ON)
129+
endif()
130+
127131
# Copy matlab.h to the correct folder.
128132
configure_file(${PROJECT_SOURCE_DIR}/wrap/matlab.h
129133
${PROJECT_BINARY_DIR}/wrap/matlab.h COPYONLY)

0 commit comments

Comments
 (0)