summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2012-12-17 18:38:36 +0100
committerDidier Raboud <odyx@debian.org>2012-12-17 22:16:07 +0100
commita1e9c4b8807e2c5a7948b4630855f8e51c1ecd93 (patch)
tree01c1a201140e7544a35f37b93a5beb99cca7928a
parent7db96b45360fa7b5b5ff905b965fdce64b219da3 (diff)
downloadcolobot-a1e9c4b8807e2c5a7948b4630855f8e51c1ecd93.tar.gz
colobot-a1e9c4b8807e2c5a7948b4630855f8e51c1ecd93.tar.bz2
colobot-a1e9c4b8807e2c5a7948b4630855f8e51c1ecd93.zip
Allow building and installation of documentation
Run `make doc` for the building. Then `make install` will install the generated documentation. - Move Doxyfile to Doxyfile.in, put CMAKE_CURRENT_SOURCE_DIR into it.
-rw-r--r--CMakeLists.txt13
-rw-r--r--Doxyfile.in (renamed from Doxyfile)4
2 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b60ac93..d12d509 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,3 +167,16 @@ set(COLOBOT_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/colobot CACHE PATH "Colobot libr
add_subdirectory(src bin)
install(DIRECTORY ../data DESTINATION ${COLOBOT_DATA_DIR})
+
+# Build and install documentation
+set(COLOBOT_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/colobot CACHE PATH "Colobot documentation directory")
+
+find_package(Doxygen)
+if(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
+ add_custom_target(doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen" VERBATIM )
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/ DESTINATION ${COLOBOT_DOC_DIR} OPTIONAL)
+endif(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
diff --git a/Doxyfile b/Doxyfile.in
index 8c5fffe..028e5de 100644
--- a/Doxyfile
+++ b/Doxyfile.in
@@ -665,8 +665,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = "src" \
- "src/CBot"
+INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/src" \
+ "@CMAKE_CURRENT_SOURCE_DIR@/src/CBot"
# 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