Skip to content

Commit

Permalink
[cmake] removing the "make api" step: now only one cmake command is n…
Browse files Browse the repository at this point in the history
…ecessary
  • Loading branch information
SimonRohou committed Apr 21, 2022
1 parent 4969a95 commit 4138c74
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 612 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ jobs:

# Building lib + tests
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install -DWITH_PYTHON=OFF -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=ON -DTEST_EXAMPLES=ON ..
make api
# Again for doxygen2docstring
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install -DWITH_PYTHON=OFF -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=ON -DTEST_EXAMPLES=ON ..
##-DPYTHON_EXECUTABLE=/usr/bin/python3.5 ..
make
#make doc # todo
Expand Down Expand Up @@ -116,9 +113,6 @@ jobs:

# Building lib + tests
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install -DWITH_PYTHON=OFF -DBUILD_TESTS=ON -DWITH_TUBE_TREE=ON -DWITH_CAPD=ON -DTEST_EXAMPLES=ON ..
make api
# Again for doxygen2docstring
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install -DWITH_PYTHON=OFF -DBUILD_TESTS=ON -DWITH_TUBE_TREE=ON -DWITH_CAPD=ON -DTEST_EXAMPLES=ON ..
##-DPYTHON_EXECUTABLE=/usr/bin/python3.5 ..
make
#make doc
Expand Down
539 changes: 0 additions & 539 deletions .travis.yml

This file was deleted.

49 changes: 28 additions & 21 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,42 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mathjax_stmaryrd.js

# Technical API documentation (Doxygen)

find_package(Doxygen)
if(WITH_PYTHON)

if(NOT DOXYGEN_FOUND)
find_package(Doxygen)

message(STATUS "Doxygen not found, not able to generate/install the API documentation.")
if(NOT DOXYGEN_FOUND)

else()
message(STATUS "Doxygen not found, not able to generate/install the API documentation.")

# Includes CMake commands in config file:
configure_file(api/Doxyfile.in api/Doxyfile)
else()

set(DOXYGEN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/api/Doxyfile)
set(DOXYGEN_OUTPUT ${APIDOC_DIR}/html/index.html)
# Includes CMake commands in config file:
configure_file(api/Doxyfile.in api/Doxyfile)

if(WIN32)
set(NULL_DEST NUL 2>&1)
else()
set(NULL_DEST "/dev/null")
endif()
set(DOXYGEN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/api/Doxyfile)
set(DOXYGEN_OUTPUT ${APIDOC_DIR}/html/index.html)

add_custom_target(api
COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation... "
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} > ${NULL_DEST}
COMMAND ${CMAKE_COMMAND} -E echo "done."
)
if(WIN32)
set(NULL_DEST NUL 2>&1)
else()
set(NULL_DEST "/dev/null")
endif()

install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/api/html
DESTINATION share/doc/${CMAKE_PROJECT_NAME}/api
OPTIONAL)
#add_custom_target(api
# COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation... "
# COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} > ${NULL_DEST}
# COMMAND ${CMAKE_COMMAND} -E echo "done."
# )

message(STATUS "Building API Documentation (mandatory for Python binding)")
execute_process(COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)

install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/api/html
DESTINATION share/doc/${CMAKE_PROJECT_NAME}/api
OPTIONAL)

endif()

endif()

Expand Down
2 changes: 1 addition & 1 deletion doc/api/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = ../../src/core/graphics/vibes/
EXCLUDE = ../src/core/graphics/vibes/

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
34 changes: 3 additions & 31 deletions doc/doc/dev/info_dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,7 @@ In case you are willing to contribute to Codac, here are some information that m
cmake <other_cmake_options> -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" ..
You will then have to generate the Doxygen documentation (XML files):

.. code-block:: bash
make api
And finally run again the ``cmake`` command:

.. code-block:: bash
cmake <other_cmake_options> -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" ..
This last step will generate header files containing docstrings for Python, based on
This configuration generates header files containing docstrings for Python, based on
the content of XML files made by Doxygen. The documentation of any C++/Python function
is then located in the C++ header files of the :file:`/src` directory.

Expand Down Expand Up @@ -111,17 +99,13 @@ The website will be generated in :file:`build/doc/`.

.. rubric:: API technical documentation

Build the API technical documentation using Doxygen:
For building the API technical documentation using Doxygen:

.. code-block:: bash

# Install Doxygen with
sudo apt install doxygen graphviz

# Build the doc
cd build
make api

The API pages will be generated in :file:`build/doc/api/html/`.


Expand Down Expand Up @@ -187,19 +171,7 @@ Then, configure ``cmake`` with custom options and ``-DWITH_PYTHON=ON``:

cmake <...> -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" ..

You will then have to generate the Doxygen documentation (XML files):

.. code-block:: bash

make api

And finally run again the ``cmake`` command:

.. code-block:: bash

cmake <other_cmake_options> -DWITH_PYTHON=ON ..

This last step will generate header files containing docstrings for Python, based on
This configuration generates header files containing docstrings for Python, based on
the content of XML files made by Doxygen. The documentation of any C++/Python function
is then located in the C++ header files of the :file:`/src` directory.

Expand Down
2 changes: 1 addition & 1 deletion doc/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ We suggest the following BibTeX template to cite Codac in scientific discourse:
.. code-block:: none
@misc{codac,
author = {Simon Rohou and Benoit Desrochers and others},
author = {Rohou, Simon and Desrochers, Benoit and others},
year = {2022},
note = {http://codac.io},
title = {The {Codac} library -- {C}onstraint-programming for robotics}
Expand Down
5 changes: 5 additions & 0 deletions doc/doc/use-cases/lie-symmetries/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. _sec-usecases-lie-symmetries:

.. warning::

Several changes are currently performed on the library.
This page may not be up to date.

#########################################
Lie symmetries for guaranteed integration
#########################################
Expand Down
5 changes: 5 additions & 0 deletions doc/doc/use-cases/loops/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. _sec-usecases-loops:

.. warning::

Several changes are currently performed on the library.
This page may not be up to date.

####################################
Loop detection in robot trajectories
####################################
Expand Down
5 changes: 5 additions & 0 deletions doc/doc/use-cases/set-inversion/02-setinv-localization.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. _sec-usecases-setinv-localization:

.. warning::

Several changes are currently performed on the library.
This page may not be up to date.

***************************
Separators for localization
***************************
Expand Down
5 changes: 5 additions & 0 deletions doc/doc/use-cases/set-inversion/03-setinv-paramestim.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. _sec-usecases-setinv-paramestim:

.. warning::

Several changes are currently performed on the library.
This page may not be up to date.

***********************************
Separators for parameter estimation
***********************************
Expand Down
5 changes: 5 additions & 0 deletions doc/doc/use-cases/set-inversion/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. _sec-usecases-setinv:

.. warning::

Several changes are currently performed on the library.
This page may not be up to date.

##############################
Set-inversion using separators
##############################
Expand Down
1 change: 0 additions & 1 deletion make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fi
fi

make -j
make api
make doc
cd ..

Expand Down
11 changes: 2 additions & 9 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@
################################################################################

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml)
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(Red "${Esc}[31m")
set(Blue "${Esc}[34m")
endif()

message(STATUS "${Red}/!\\ Run \"make api\" for generating Doxygen doc, then \"cmake ..\" again, before \"make\"${ColourReset}")
# The file generated_docstring.cpp contains all docstring of the library
message(FATAL_ERROR "Unable to find Doxygen generated files, this is required for Python binding (docstring)")
endif()

message(STATUS "Generating docstrings from doxygen files...")
Expand All @@ -45,7 +39,6 @@
${PROJECT_SOURCE_DIR}/scripts/pybind/doxygen2docstring.py
${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
${CMAKE_CURRENT_BINARY_DIR}/docstring)
# The file generated_docstring.cpp contains all docstring of the library


################################################################################
Expand Down
3 changes: 0 additions & 3 deletions scripts/docker/build_pybinding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ for PYBIN in /opt/python/cp3*/bin; do
"${PYBIN}/python" -m pip install --upgrade pip
mkdir -p build_dir && cd build_dir
cmake -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" ..
make api
# Again for doxygen2docstring:
cmake -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" ..
make -j2

#make test ARGS="-V"s
Expand Down

0 comments on commit 4138c74

Please sign in to comment.