Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

out-of-source API documentation build (2/2): update CMakeLists.txt an…

…d doxygen.conf.tmpl

docs/doxygen.conf.tmp: take input files from @SOURCE_DIR@/
docs/MakeLists.txt:
  - create ${CMAKE_CURRENT_BINARY_DIR}/docs/doxygen.conf from template
  - generate all docs targets in ${CMAKE_CURRENT_BINARY_DIR}
  - install all docs targets to ${CMAKE_INSTALL_PREFIX}
  • Loading branch information...
commit 0523a6c275e56b96ec5136544a72b0e84e66a607 1 parent b278e09
@gajdusek gajdusek authored
Showing with 42 additions and 44 deletions.
  1. +26 −28 docs/CMakeLists.txt
  2. +16 −16 docs/doxygen.conf.tmpl
View
54 docs/CMakeLists.txt
@@ -1,3 +1,6 @@
+####################################
+## Manual pages ##
+
FILE(GLOB man1 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"*.1")
@@ -9,6 +12,8 @@ install(FILES ${man1}
install(FILES ${man8}
DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man8)
+####################################
+## Convert wiki pages to TXT/HTML ##
FILE(GLOB docfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"wiki/*.md")
@@ -47,46 +52,39 @@ endmacro(CONVDOC)
CONVDOC(.html html html)
CONVDOC("" plain txt)
-# Setup a target to drive the conversion
+
ADD_CUSTOM_TARGET(docs-html DEPENDS ${htmlFiles})
ADD_CUSTOM_TARGET(docs-txt DEPENDS ${txtFiles})
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/doc/ulatencyd
+ OPTIONAL)
+
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/txt
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/doc/ulatencyd
+ OPTIONAL)
+
+####################################
+## API Doxygen documentation ##
+
+# Doxygen outputs relative to directory where it was started, create doxygen.conf
+# from template where INPUT directories are preprended with ${CMAKE_SOURCE_DIR}
+configure_file(doxygen.conf.tmpl ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf @ONLY)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/api
)
add_custom_target(docs-api
- doxygen ${CMAKE_SOURCE_DIR}/docs/doxygen.conf
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ doxygen ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/api)
-install(DIRECTORY api
- DESTINATION doc/ulatencyd
- OPTIONAL)
-
-install(DIRECTORY html
- DESTINATION doc/ulatencyd
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/doc/ulatencyd
OPTIONAL)
-install(DIRECTORY txt
- DESTINATION doc/ulatencyd
- OPTIONAL)
+####################################
+## docs target ##
add_custom_target(docs)
add_dependencies(docs docs-txt docs-html docs-api)
-
-
-# macro(CONVDOC GLOB SUFFIX TARGET_FORMAT)
-# file(GLOB DOCS RELATIVE wiki ${GLOB})
-# message(${DOCS})
-# file(MAKE_DIRECTORY ${TARGET_FORMAT})
-# foreach(cfile in DOCS)
-# message(string(REPLACE ".md" "${SUFFIX}"))
-# #set(ofile, string(REPLACE ".md" "${SUFFIX}"))
-# #execute_process(pandoc -o ${TARGET_FORMAT}/${ofile} -t {TARGET_FORMAT} -f markdown ${cfile})
-# endforeach(cfile in DOCS)
-# endmacro(CONVDOC)
-#
-#
-# add_custom_target(docs-html
-# COMMAND )
View
32 docs/doxygen.conf.tmpl
@@ -52,7 +52,7 @@ PROJECT_LOGO =
# 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 = docs/api
+OUTPUT_DIRECTORY = api
# 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
@@ -655,15 +655,15 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = src \
- src/proc \
- rules \
- modules \
- client \
- conf/scheduler \
- src/docs/doxygen \
- docs \
- docs/wiki
+INPUT = @CMAKE_SOURCE_DIR@/src \
+ @CMAKE_SOURCE_DIR@/src/proc \
+ @CMAKE_SOURCE_DIR@/rules \
+ @CMAKE_SOURCE_DIR@/modules \
+ @CMAKE_SOURCE_DIR@/client \
+ @CMAKE_SOURCE_DIR@/conf/scheduler \
+ @CMAKE_SOURCE_DIR@/src/docs/doxygen \
+ @CMAKE_SOURCE_DIR@/docs \
+ @CMAKE_SOURCE_DIR@/docs/wiki
# 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
@@ -700,7 +700,7 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = docs/wiki/Architecture.md
+EXCLUDE = @CMAKE_SOURCE_DIR@/docs/wiki/Architecture.md
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -728,8 +728,8 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH = rules \
- conf
+EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/rules \
+ @CMAKE_SOURCE_DIR@/conf
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -749,7 +749,7 @@ EXAMPLE_RECURSIVE = YES
# directories that contain image that are included in the documentation (see
# the \image command).
-IMAGE_PATH = docs
+IMAGE_PATH = @CMAKE_SOURCE_DIR@/docs
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -771,8 +771,8 @@ INPUT_FILTER =
# info on how filters are used. If FILTER_PATTERNS is empty or if
# non of the patterns match the file name, INPUT_FILTER is applied.
-FILTER_PATTERNS = *.lua=scripts/lua2dox/lua2dox \
- *.ldox=scripts/lua2dox/lua2dox
+FILTER_PATTERNS = *.lua=@CMAKE_SOURCE_DIR@/scripts/lua2dox/lua2dox \
+ *.ldox=@CMAKE_SOURCE_DIR@/scripts/lua2dox/lua2dox
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
Please sign in to comment.
Something went wrong with that request. Please try again.