From 71f3f71f7817e24cbd961ce5b9f3db00e1122f5e Mon Sep 17 00:00:00 2001 From: vocollapse Date: Sun, 12 Oct 2014 11:28:56 +0200 Subject: [PATCH 1/2] added make target for doxygen: make doc, make doc_pages --- CMakeLists.txt | 17 ++++++++++++++++- docs/{Doxyfile => Doxyfile.in} | 10 +++++----- docs/{DoxyfilePages => DoxyfilePages.in} | 10 +++++----- 3 files changed, 26 insertions(+), 11 deletions(-) rename docs/{Doxyfile => Doxyfile.in} (99%) rename docs/{DoxyfilePages => DoxyfilePages.in} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 542ea3e94..6725ec64b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ endif (ANDROID) # doxygen main page -configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_DIR}/docs/mainpage.hpp") +configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp") option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE) option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE) @@ -836,3 +836,18 @@ if (APPLE) include(CPack) endif (APPLE) +# Doxygen Target -- simply run 'make doc' or 'make doc_pages' +find_package(Doxygen) +if(DOXYGEN_FOUND) + configure_file(${OpenMW_SOURCE_DIR}/docs/Doxyfile.in ${OpenMW_BINARY_DIR}/docs/Doxyfile @ONLY) + configure_file(${OpenMW_SOURCE_DIR}/docs/DoxyfilePages.in ${OpenMW_BINARY_DIR}/docs/DoxyfilePages @ONLY) + add_custom_target(doc + ${DOXYGEN_EXECUTABLE} ${OpenMW_BINARY_DIR}/docs/Doxyfile + WORKING_DIRECTORY ${OpenMW_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen (from Doxyfile)" VERBATIM) + add_custom_target(doc_pages + ${DOXYGEN_EXECUTABLE} ${OpenMW_BINARY_DIR}/docs/DoxyfilePages + WORKING_DIRECTORY ${OpenMW_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen (from DoxyfilePages)" VERBATIM) +endif(DOXYGEN_FOUND) + diff --git a/docs/Doxyfile b/docs/Doxyfile.in similarity index 99% rename from docs/Doxyfile rename to docs/Doxyfile.in index a74fc7b0a..b5022ca8a 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile.in @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = Doxygen +OUTPUT_DIRECTORY = @OpenMW_SOURCE_DIR@/docs/Doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -764,10 +764,10 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = apps \ - components \ - libs \ - docs +INPUT = @OpenMW_SOURCE_DIR@/apps \ + @OpenMW_SOURCE_DIR@/components \ + @OpenMW_SOURCE_DIR@/libs \ + @OpenMW_BINARY_DIR@/docs # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/docs/DoxyfilePages b/docs/DoxyfilePages.in similarity index 99% rename from docs/DoxyfilePages rename to docs/DoxyfilePages.in index dca9d7a12..cb9dc37d6 100644 --- a/docs/DoxyfilePages +++ b/docs/DoxyfilePages.in @@ -38,7 +38,7 @@ PROJECT_NUMBER = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = ../doxygen +OUTPUT_DIRECTORY = @OpenMW_SOURCE_DIR@/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -573,10 +573,10 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = apps \ - components \ - libs \ - docs +INPUT = @OpenMW_SOURCE_DIR@/apps \ + @OpenMW_SOURCE_DIR@/components \ + @OpenMW_SOURCE_DIR@/libs \ + @OpenMW_BINARY_DIR@/docs # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is From 772c66eedf09e9eb8a5f349cf95c1bce27579074 Mon Sep 17 00:00:00 2001 From: vocollapse Date: Sun, 12 Oct 2014 18:30:39 +0200 Subject: [PATCH 2/2] Changed Doxygen file extensions to .cmake for consistency. Also changed output directories for doxygen. --- CMakeLists.txt | 20 +++++++++++++------ docs/{Doxyfile.in => Doxyfile.cmake} | 4 ++-- .../{DoxyfilePages.in => DoxyfilePages.cmake} | 4 ++-- 3 files changed, 18 insertions(+), 10 deletions(-) rename docs/{Doxyfile.in => Doxyfile.cmake} (99%) rename docs/{DoxyfilePages.in => DoxyfilePages.cmake} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6725ec64b..2feb2aeac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -837,17 +837,25 @@ if (APPLE) endif (APPLE) # Doxygen Target -- simply run 'make doc' or 'make doc_pages' +# output directory for 'make doc' is "${OpenMW_BINARY_DIR}/docs/Doxygen" +# output directory for 'make doc_pages' is "${DOXYGEN_PAGES_OUTPUT_DIR}" if defined +# or "${OpenMW_BINARY_DIR}/docs/Pages" otherwise find_package(Doxygen) -if(DOXYGEN_FOUND) - configure_file(${OpenMW_SOURCE_DIR}/docs/Doxyfile.in ${OpenMW_BINARY_DIR}/docs/Doxyfile @ONLY) - configure_file(${OpenMW_SOURCE_DIR}/docs/DoxyfilePages.in ${OpenMW_BINARY_DIR}/docs/DoxyfilePages @ONLY) +if (DOXYGEN_FOUND) + # determine output directory for doc_pages + if (NOT DEFINED DOXYGEN_PAGES_OUTPUT_DIR) + set(DOXYGEN_PAGES_OUTPUT_DIR "${OpenMW_BINARY_DIR}/docs/Pages") + endif () + configure_file(${OpenMW_SOURCE_DIR}/docs/Doxyfile.cmake ${OpenMW_BINARY_DIR}/docs/Doxyfile @ONLY) + configure_file(${OpenMW_SOURCE_DIR}/docs/DoxyfilePages.cmake ${OpenMW_BINARY_DIR}/docs/DoxyfilePages @ONLY) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${OpenMW_BINARY_DIR}/docs/Doxyfile WORKING_DIRECTORY ${OpenMW_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen (from Doxyfile)" VERBATIM) + COMMENT "Generating Doxygen documentation at ${OpenMW_BINARY_DIR}/docs/Doxygen" + VERBATIM) add_custom_target(doc_pages ${DOXYGEN_EXECUTABLE} ${OpenMW_BINARY_DIR}/docs/DoxyfilePages WORKING_DIRECTORY ${OpenMW_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen (from DoxyfilePages)" VERBATIM) -endif(DOXYGEN_FOUND) + COMMENT "Generating documentation for the github-pages at ${DOXYGEN_PAGES_OUTPUT_DIR}" VERBATIM) +endif () diff --git a/docs/Doxyfile.in b/docs/Doxyfile.cmake similarity index 99% rename from docs/Doxyfile.in rename to docs/Doxyfile.cmake index b5022ca8a..38ad84165 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.cmake @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @OpenMW_SOURCE_DIR@/docs/Doxygen +OUTPUT_DIRECTORY = @OpenMW_BINARY_DIR@/docs/Doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -767,7 +767,7 @@ WARN_LOGFILE = INPUT = @OpenMW_SOURCE_DIR@/apps \ @OpenMW_SOURCE_DIR@/components \ @OpenMW_SOURCE_DIR@/libs \ - @OpenMW_BINARY_DIR@/docs + @OpenMW_BINARY_DIR@/docs/mainpage.hpp # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/docs/DoxyfilePages.in b/docs/DoxyfilePages.cmake similarity index 99% rename from docs/DoxyfilePages.in rename to docs/DoxyfilePages.cmake index cb9dc37d6..d50a043d6 100644 --- a/docs/DoxyfilePages.in +++ b/docs/DoxyfilePages.cmake @@ -38,7 +38,7 @@ PROJECT_NUMBER = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @OpenMW_SOURCE_DIR@/doxygen +OUTPUT_DIRECTORY = @DOXYGEN_PAGES_OUTPUT_DIR@ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -576,7 +576,7 @@ WARN_LOGFILE = INPUT = @OpenMW_SOURCE_DIR@/apps \ @OpenMW_SOURCE_DIR@/components \ @OpenMW_SOURCE_DIR@/libs \ - @OpenMW_BINARY_DIR@/docs + @OpenMW_BINARY_DIR@/docs/mainpage.hpp # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is