Fix the doc build.

- Fix the doc target management: now working whatever the combination of modules that is asked.
- Add edo to the doc targets.
- Add a warning when doxygen is not found.
This commit is contained in:
Johann Dreo 2018-12-08 21:11:41 +01:00
commit 4f726f482d
3 changed files with 115 additions and 13 deletions

View file

@ -37,6 +37,11 @@ SET(GLOBAL_VERSION "${VERSION}")
## Optional
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/module" CACHE INTERNAL "Cmake module" FORCE)
include(FindDoxygen OPTIONAL)
if(NOT DOXYGEN_FOUND)
message(WARNING "Doxygen was not found, install it if you want to generate the documentation.")
else()
message(STATUS "Doxygen found, use the target `doc` to generate the documentation.")
endif()
######################################################################################
### 3) Include CMake files

View file

@ -11,22 +11,119 @@ endif(UNIX)
######################################################################################
if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
if(SMP)
# FIXME this would work in cmake 3.13
# set(DOC_EO "make doc-eo")
# if(NOT EO_ONLY)
# set(DOC_MO "make doc-mo")
# set(DOC_MOEO "make doc-moeo")
# if(EDO)
# set(DOC_EDO "make doc-edo")
# else()
# set(DOC_EDO "")
# endif()
# if(SMP)
# set(DOC_SMP "make doc-smp")
# else()
# set(DOC_SMP "")
# endif()
# if(MPI)
# set(DOC_MPI "make doc-mpi")
# else()
# set(DOC_MPI "")
# endif()
# endif()
#
# add_custom_target(doc
# COMMAND ${DOC_EO}
# COMMAND ${DOC_MO}
# COMMAND ${DOC_MOEO}
# COMMAND ${DOC_EDO}
# COMMAND ${DOC_SMP}
# COMMAND ${DOC_MPI}
# )
# FIXME in the meantime, we must enumerate...
if(EO_ONLY)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-edo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-smp
)
else()
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-edo
COMMAND make doc-mo
COMMAND make doc-moeo
)
endif()
# No optional module.
if(NOT EDO AND NOT SMP AND NOT MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
)
endif()
# One optional module.
if(EDO AND NOT SMP AND NOT MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-edo
)
endif()
if(NOT EDO AND SMP AND NOT MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-smp
)
endif()
if(NOT EDO AND NOT SMP AND MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-mpi
)
endif()
# Two optional modules.
if(NOT EDO AND SMP AND MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-smp
COMMAND make doc-mpi
)
endif()
if(EDO AND NOT SMP AND MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-edo
COMMAND make doc-mpi
)
endif()
if(EDO AND SMP AND NOT MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-edo
COMMAND make doc-smp
)
endif()
# Three optional modules
if(EDO AND SMP AND MPI)
add_custom_target(doc
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-edo
COMMAND make doc-smp
COMMAND make doc-mpi
)
endif()
endif(EO_ONLY)
endif(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
######################################################################################

View file

@ -26,8 +26,8 @@ endif()
### Include subdirectories
######################################################################################
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(doc)
if(ENABLE_CMAKE_TESTING AND EIGEN3_FOUND) # see edoNormalAdaptive
add_subdirectory(test)