summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2020-12-10 23:57:27 +0100
committerglx22 <glx22@users.noreply.github.com>2020-12-12 15:48:04 +0100
commit6fae0b83d9f0ddc28d6f1cadf3c8aef126004429 (patch)
treeb2d0ee8b9a9a144048f00d0e2285922ef542e1aa /src/script
parent7f5afbfdf5ac288da188276430c30b3ed0af99f8 (diff)
downloadopenttd-6fae0b83d9f0ddc28d6f1cadf3c8aef126004429.tar.xz
Add: [CMake] targets to generate documentation
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/CMakeLists.txt17
-rw-r--r--src/script/api/Doxyfile_AI.in (renamed from src/script/api/Doxyfile_AI)14
-rw-r--r--src/script/api/Doxyfile_GS.in (renamed from src/script/api/Doxyfile_Game)14
3 files changed, 25 insertions, 20 deletions
diff --git a/src/script/api/CMakeLists.txt b/src/script/api/CMakeLists.txt
index e294cfd05..9bc4183f1 100644
--- a/src/script/api/CMakeLists.txt
+++ b/src/script/api/CMakeLists.txt
@@ -100,6 +100,23 @@ foreach(API "ai;AI" "game;GS" "template;Template")
add_dependencies(script_api
script_${APILC}_includes
)
+
+ # Documentation
+ if(DOXYGEN_EXECUTABLE)
+ add_custom_target(docs_${APILC}
+ ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/docs
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile_${APIUC}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating documentation for ${APILC} API"
+ )
+ add_dependencies(docs_${APILC}
+ find_version
+ script_window
+ )
+ add_dependencies(docs
+ docs_${APILC}
+ )
+ endif()
else()
add_dependencies(script_api
script_${APILC}
diff --git a/src/script/api/Doxyfile_AI b/src/script/api/Doxyfile_AI.in
index fb0abc056..f0707e0d8 100644
--- a/src/script/api/Doxyfile_AI
+++ b/src/script/api/Doxyfile_AI.in
@@ -10,8 +10,8 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "OpenTTD AI API"
-PROJECT_NUMBER = $(VERSION)
-OUTPUT_DIRECTORY = ../../../docs/aidocs/
+PROJECT_NUMBER = ${REV_VERSION}
+OUTPUT_DIRECTORY = ${CPACK_BINARY_DIR}/docs/ai-api/
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -76,7 +76,6 @@ GENERATE_DEPRECATEDLIST= NO
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
-SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
@@ -91,7 +90,7 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = . $(GENERATED_API_DIR)
+INPUT = . ${FIND_VERSION_BINARY_DIR}/script/api
INPUT_ENCODING = UTF-8
FILE_PATTERNS = script_*.hpp \
ai_*.hpp
@@ -133,7 +132,6 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
@@ -181,8 +179,6 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -211,15 +207,13 @@ SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
-GENERATE_TAGFILE = ../../../objs/openttd_noai.tag
+GENERATE_TAGFILE = ${CPACK_BINARY_DIR}/docs/openttd_ai_api.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
-MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
diff --git a/src/script/api/Doxyfile_Game b/src/script/api/Doxyfile_GS.in
index 83f8ad0e8..7dae7aad6 100644
--- a/src/script/api/Doxyfile_Game
+++ b/src/script/api/Doxyfile_GS.in
@@ -10,8 +10,8 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "OpenTTD GameScript API"
-PROJECT_NUMBER = $(VERSION)
-OUTPUT_DIRECTORY = ../../../docs/gamedocs/
+PROJECT_NUMBER = ${REV_VERSION}
+OUTPUT_DIRECTORY = ${CPACK_BINARY_DIR}/docs/gs-api/
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -76,7 +76,6 @@ GENERATE_DEPRECATEDLIST= NO
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
-SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
@@ -91,7 +90,7 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = . $(GENERATED_API_DIR)
+INPUT = . ${FIND_VERSION_BINARY_DIR}/script/api
INPUT_ENCODING = UTF-8
FILE_PATTERNS = script_*.hpp \
game_*.hpp
@@ -133,7 +132,6 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
@@ -181,8 +179,6 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -211,15 +207,13 @@ SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
-GENERATE_TAGFILE = ../../../objs/openttd_nogo.tag
+GENERATE_TAGFILE = ${CPACK_BINARY_DIR}/docs/openttd_gs_api.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
-MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES