ddl/doc/run_doxygen.cmake.in
2019-12-12 14:41:47 +01:00

50 lines
2.9 KiB
CMake

##generate the doxyfile to stdout
execute_process(COMMAND @DOXYGEN_EXECUTABLE@ -s -g - OUTPUT_VARIABLE doxygen_out)
##set any doxygen tag according to our needs, leave the rest untouched (= default)
# never use the absolute path for INPUT, otherwise call graphs might be generated with absolute
# paths inside. Use relative path and execute doxygen from within install dir WORKING_DIRECTORY
# We could just use @CMAKE_CURRENT_SOURCE_DIR@/input to include all *.md files, but this way we can specify their order for the index
string(REGEX REPLACE "(INPUT +[=])"
"\\1 codec ddlrepresentation mapping serialization @CMAKE_CURRENT_SOURCE_DIR@/../README.md \
@CURRENT_IMPORTS_DIR@/licenses/list_used_licenses.md \
@CMAKE_CURRENT_SOURCE_DIR@/changelog.md @CMAKE_CURRENT_SOURCE_DIR@/input/ddl_specification.md \
@CMAKE_CURRENT_SOURCE_DIR@/input/oo-ddl.md \
@CMAKE_CURRENT_SOURCE_DIR@/input/codec.md @CMAKE_CURRENT_SOURCE_DIR@/input/ddl_generators.md \
@CMAKE_CURRENT_SOURCE_DIR@/input/mapping_specification.md @CMAKE_CURRENT_SOURCE_DIR@/input/mpl.md \
@CMAKE_CURRENT_SOURCE_DIR@/input/migration_4_1.md \
@CMAKE_CURRENT_SOURCE_DIR@/input/used_licenses.md" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(RECURSIVE +[=]) NO"
"\\1 YES" doxygen_out ${doxygen_out})
#string(REGEX REPLACE "(FILE_PATTERNS +[=])"
# "\\1 readme.txt " doxygen_out ${doxygen_out})
string(REGEX REPLACE "(PROJECT_NAME +[=]) \"My Project\""
"\\1 \"ddl_library\"" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(PROJECT_NUMBER +[=])"
"\\1 v@PROJECT_VERSION@" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(OUTPUT_DIRECTORY +[=])"
"\\1 @CMAKE_INSTALL_PREFIX@/doc" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(SHORT_NAMES +[=]) NO"
"\\1 YES" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(GENERATE_LATEX +[=]) YES"
"\\1 NO" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(HAVE_DOT +[=]) NO"
"\\1 @DOXYGEN_DOT_FOUND@" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(DOT_PATH +[=])"
"\\1 @DOXYGEN_DOT_EXECUTABLE@" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(PREDEFINED +[=])"
"\\1 ${_predefined}" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(EXAMPLE_PATH +[=])"
"\\1 ../doc/license" doxygen_out ${doxygen_out})
string(REGEX REPLACE "(GENERATE_TREEVIEW +[=]) NO"
"\\1 YES" doxygen_out ${doxygen_out})
##generate the documentation with doxygen
file(WRITE @CMAKE_CURRENT_BINARY_DIR@/Doxyfile ${doxygen_out})
execute_process(COMMAND @DOXYGEN_EXECUTABLE@ @CMAKE_CURRENT_BINARY_DIR@/Doxyfile
WORKING_DIRECTORY @CMAKE_INSTALL_PREFIX@/include/)
unset(_predefined)