Blob Blame History Raw
From 2cbde92533c48e0370480d2edc0c262460be27ee Mon Sep 17 00:00:00 2001
From: Theodore Papadopoulo <Theodore.Papadopoulo@inria.fr>
Date: Fri, 11 Oct 2019 10:28:25 +0200
Subject: [PATCH 1/4] Minor style tweaks.

---
 documentation/CMakeLists.txt           |  8 +++----
 documentation/reference/CMakeLists.txt | 30 ++++++++++++--------------
 wrapping/src/CMakeLists.txt            |  5 ++---
 3 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
index 520627d1..96d24252 100644
--- a/documentation/CMakeLists.txt
+++ b/documentation/CMakeLists.txt
@@ -4,8 +4,6 @@
 #              # OPTIONAL_COMPONENTS mscgen dia)
 
 
-IF (BUILD_REFERENCE_DOC)# XXX: the right condition should be (BUILD_REFERENCE_DOC and DOXYGEN_FOUND) therefore, Doxygen should be found ind documentation rather than its subdirectories
-    SUBDIRS(reference)
-ENDIF (BUILD_REFERENCE_DOC)
-
-# XXX: Add a test to ensure that documentation is generated properly
+if (BUILD_REFERENCE_DOC)# XXX: the right condition should be (BUILD_REFERENCE_DOC and DOXYGEN_FOUND) therefore, Doxygen should be found in documentation rather than its subdirectories
+    subdirs(reference)
+endif()
diff --git a/documentation/reference/CMakeLists.txt b/documentation/reference/CMakeLists.txt
index 01ebb8a6..669a2641 100644
--- a/documentation/reference/CMakeLists.txt
+++ b/documentation/reference/CMakeLists.txt
@@ -2,9 +2,9 @@
 # Build the documentation
 #
 
-INCLUDE (Documentation OPTIONAL)
+include(Documentation OPTIONAL)
 
-IF (BUILD_DOCUMENTATION)
+if (BUILD_DOCUMENTATION)
 
     #
     # Configure the script and the doxyfile, then add target
@@ -20,30 +20,28 @@ IF (BUILD_DOCUMENTATION)
     #                             Consider installing this package.")
     #       endif(NOT DOXYGEN_DOT_FOUND)
     #
-    IF(NOT DOT_PATH)
-        GET_FILENAME_COMPONENT(DOT_PATH ${DOT} PATH)
-    ENDIF(NOT DOT_PATH)
+    if (NOT DOT_PATH)
+        get_filename_component(DOT_PATH ${DOT} PATH)
+    endif()
 
 
-    IF (NOT USE_CGAL)
-        SET(OpenMEEG_EXCLUDE_FROM_DOCUMENTATION
+    if (NOT USE_CGAL)
+        set(OpenMEEG_EXCLUDE_FROM_DOCUMENTATION
             "${OpenMEEG_EXCLUDE_FROM_DOCUMENTATION} ${CMAKE_SOURCE_DIR}/tools/cgal_mesh_create.cpp ${CMAKE_SOURCE_DIR}/tools/cgal_mesh_include.h")
-    ENDIF()
-    CONFIGURE_FILE(
+    endif()
+    configure_file(
         ${OpenMEEG_SOURCE_DIR}/documentation/reference/doxyfile.in
         ${OpenMEEG_BINARY_DIR}/documentation/reference/doxyfile)
 
     #   The ALL in the next directive is necessary to cope with a CMake bug !!!
     #   Otherwise the target is never activated.
 
-    ADD_CUSTOM_TARGET(OpenMEEG-documentation ALL)
-
-    ADD_DEPENDENCIES(OpenMEEG-documentation OpenMEEG-doxygen_outputs)
-
-    ADD_CUSTOM_TARGET(OpenMEEG-doxygen_outputs
+    add_custom_target(OpenMEEG-documentation ALL)
+    add_dependencies(OpenMEEG-documentation OpenMEEG-doxygen_outputs)
+    add_custom_target(OpenMEEG-doxygen_outputs
                       COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxyfile
                       DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
 
-    INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION share/doc/OpenMEEG/reference)
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION share/doc/OpenMEEG/reference)
 
-ENDIF (BUILD_DOCUMENTATION)
+endif()
diff --git a/wrapping/src/CMakeLists.txt b/wrapping/src/CMakeLists.txt
index 1be66348..47258644 100644
--- a/wrapping/src/CMakeLists.txt
+++ b/wrapping/src/CMakeLists.txt
@@ -33,7 +33,6 @@ else()
   include(${SWIG_USE_FILE})
 endif()
 
-
 if (BUILD_DOCUMENTATION)
     # In order to generate python docstrings we use doxy2swig (which is bundled in our codebase)
     # doxy2swig takes xml output from doxygen and generates a .i file that can be include in openmeeg.i
@@ -116,9 +115,9 @@ if (BUILD_TESTING)
       endif()
     endforeach()
 
-    if(BUILD_REFERENCE_DOC)
+    if (BUILD_REFERENCE_DOC)
         execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${OpenMEEG_SOURCE_DIR}/wrapping/src/test_doc.py ${OpenMEEG_BINARY_DIR}/wrapping/src/)
         add_test(openmeeg_python_doc ${PYTHON_EXECUTABLE} ${OpenMEEG_BINARY_DIR}/wrapping/src/test_doc.py)
-    endif(BUILD_REFERENCE_DOC)
+    endif()
 
 endif()

From 985d515e7adbc60e3f4bf86c6e1e868940a54a8d Mon Sep 17 00:00:00 2001
From: Theodore Papadopoulo <Theodore.Papadopoulo@inria.fr>
Date: Fri, 11 Oct 2019 10:29:07 +0200
Subject: [PATCH 2/4] Include docstrings.i when available.

---
 wrapping/src/openmeeg.i | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/wrapping/src/openmeeg.i b/wrapping/src/openmeeg.i
index 9a91cb4f..fc1ee595 100644
--- a/wrapping/src/openmeeg.i
+++ b/wrapping/src/openmeeg.i
@@ -13,6 +13,9 @@
 %include <windows.i>
 #endif
 
+#ifdef DOCSTRINGS
+%include <docstrings.i>
+#endif
 
 %include <std_string.i>
 %include <std_vector.i>

From 6bb5238112b67c2ce31d5d1cc4cbc1c38bedf75e Mon Sep 17 00:00:00 2001
From: Joan Massich <sik@visor.udg.edu>
Date: Fri, 11 Oct 2019 13:12:50 +0200
Subject: [PATCH 3/4] add doc to travis

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index a7954142..0b7ac71b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,7 +28,7 @@ matrix:
         - ENABLE_PYTHON=ON
         - ANALYSE=ON
         - ENABLE_COVERAGE=ON
-        - BUILD_DOCUMENTATION=OFF
+        - BUILD_DOCUMENTATION=ON
         - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
       addons:
         apt:

From 1ada3bcd567b8173214a1590b0106b07de8bcddf Mon Sep 17 00:00:00 2001
From: Theodore Papadopoulo <Theodore.Papadopoulo@inria.fr>
Date: Fri, 11 Oct 2019 14:16:25 +0200
Subject: [PATCH 4/4] Add a dependency of docstring.i when necessary.

---
 wrapping/src/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wrapping/src/CMakeLists.txt b/wrapping/src/CMakeLists.txt
index 47258644..d97f5208 100644
--- a/wrapping/src/CMakeLists.txt
+++ b/wrapping/src/CMakeLists.txt
@@ -50,10 +50,11 @@ if (BUILD_DOCUMENTATION)
     list(APPEND CMAKE_SWIG_FLAGS "-DDOCSTRINGS")
     add_custom_target(docstrings DEPENDS docstrings.i)
     add_dependencies(OpenMEEG-documentation docstrings)
+    set(DOCSTRING_DEPS DEPENDS docstrings)
 endif()
 
 list(APPEND CMAKE_SWIG_FLAGS -v -O)
-set_source_files_properties(openmeeg.i PROPERTIES CPLUSPLUS ON)
+set_source_files_properties(openmeeg.i PROPERTIES CPLUSPLUS ON ${DOCSTRING_DEPS})
 swig_add_library(openmeeg LANGUAGE python SOURCES openmeeg.i)
 swig_link_libraries(openmeeg ${PYTHON_LIBRARIES} OpenMEEG::OpenMEEG)