Commit 4b1fb7c8 authored by Steffen Müthing's avatar Steffen Müthing

Merge branch 'feature/fix-cmake-documentation-without-doxylocal' into 'master'

[cmake][bugfix] Make CMake Doxygen creation work for modules without Doxylocal

When creating Doxygen documentation, CMake currently assumes that all
modules have a Doxylocal file, which is in fact only present in
dune-common right now. That file is then used as both a dependency and a
file reading input, causing CMake errors.

This patch fixes the problem by testing for the presence of Doxylocal
and only including it in the build process if it was found.

See merge request !61
parents 834efd97 bb02f3f3
......@@ -43,11 +43,23 @@ add_custom_target(doxygen_install)
# Doxyfile[.in] files needed to doxygen.
MACRO (prepare_doxyfile)
message(STATUS "using ${DOXYSTYLE_FILE} to create doxystyle file")
set(make_doxyfile_command ${CMAKE_COMMAND} -D DOT_TRUE=${DOT_TRUE} -D DUNEWEB_TRUE=\# -D ProjectName=${ProjectName} -D DUNE_MOD_VERSION=${DUNE_MOD_VERSION} -D DOXYSTYLE=${DOXYSTYLE_FILE} -D DOXYLOCAL=${CMAKE_CURRENT_SOURCE_DIR}/Doxylocal -D abs_top_srcdir=${CMAKE_SOURCE_DIR} -D srcdir=${CMAKE_CURRENT_SOURCE_DIR} -D top_srcdir=${CMAKE_SOURCE_DIR} -P ${SCRIPT_DIR}/CreateDoxyFile.cmake)
add_custom_command (OUTPUT Doxyfile.in Doxyfile
COMMAND ${make_doxyfile_command}
COMMENT "Creating Doxyfile.in"
DEPENDS ${DOXYSTYLE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxylocal)
# check whether module has a Doxylocal file
file(_DOXYLOCAL PATHS ${CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
if(_DOXYLOCAL)
set(make_doxyfile_command ${CMAKE_COMMAND} -D DOT_TRUE=${DOT_TRUE} -D DUNEWEB_TRUE=\# -D ProjectName=${ProjectName} -D DUNE_MOD_VERSION=${DUNE_MOD_VERSION} -D DOXYSTYLE=${DOXYSTYLE_FILE} -D DOXYLOCAL=${CMAKE_CURRENT_SOURCE_DIR}/Doxylocal -D abs_top_srcdir=${CMAKE_SOURCE_DIR} -D srcdir=${CMAKE_CURRENT_SOURCE_DIR} -D top_srcdir=${CMAKE_SOURCE_DIR} -P ${SCRIPT_DIR}/CreateDoxyFile.cmake)
add_custom_command (OUTPUT Doxyfile.in Doxyfile
COMMAND ${make_doxyfile_command}
COMMENT "Creating Doxyfile.in"
DEPENDS ${DOXYSTYLE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxylocal)
else()
set(make_doxyfile_command ${CMAKE_COMMAND} -D DOT_TRUE=${DOT_TRUE} -D DUNEWEB_TRUE=\# -D ProjectName=${ProjectName} -D DUNE_MOD_VERSION=${DUNE_MOD_VERSION} -D DOXYSTYLE=${DOXYSTYLE_FILE} -D DOXYLOCAL=${CMAKE_CURRENT_SOURCE_DIR}/Doxylocal -D abs_top_srcdir=${CMAKE_SOURCE_DIR} -D top_srcdir=${CMAKE_SOURCE_DIR} -P ${SCRIPT_DIR}/CreateDoxyFile.cmake)
add_custom_command (OUTPUT Doxyfile.in Doxyfile
COMMAND ${make_doxyfile_command}
COMMENT "Creating Doxyfile.in"
DEPENDS ${DOXYSTYLE_FILE})
endif()
add_custom_target(Doxyfile DEPENDS Doxyfile.in Doxyfile)
ENDMACRO (prepare_doxyfile)
......
#For now we just support appending Doxyfile and Doxylocal
FILE(READ ${DOXYSTYLE} file_contents)
FILE(WRITE Doxyfile.in ${file_contents})
FILE(READ ${DOXYLOCAL} file_contents)
if(_DOXYLOCAL)
FILE(READ ${DOXYLOCAL} file_contents)
endif()
FILE(APPEND Doxyfile.in ${file_contents})
# configure_file does not work as it insists an existing input file, which in our
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment