1 # vim:ts=4:sw=4:expandtab:autoindent:
3 # Copyright (C) 1997-2015 by Dimitri van Heesch.
5 # Permission to use, copy, modify, and distribute this software and its
6 # documentation under the terms of the GNU General Public License is hereby
7 # granted. No representations are made about the suitability of this software
8 # for any purpose. It is provided "as is" without express or implied warranty.
9 # See the GNU General Public License for more details.
11 # Documents produced by Doxygen are derivative works derived from the
12 # input used in their production; they are not affected by this license.
14 include (${TOP}/cmake/version.cmake)
15 string(TIMESTAMP DATE "%d-%m-%Y")
17 find_package(PythonInterp REQUIRED)
18 find_program(EPSTOPDF NAMES epstopdf )
19 find_program(PDFLATEX NAMES pdflatex )
20 find_program(MAKEINDEX NAMES makeindex )
21 include(GNUInstallDirs)
23 if (doxygen_BINARY_DIR)
24 set(DOXYGEN_EXECUTABLE ${doxygen_BINARY_DIR}/bin/doxygen)
26 # when building only the doxygen_doc, from the doc/ directory, the
27 # doxygen project variables are unknown so look for doxygen in PATH
31 set(DOC_INSTALL_DIR "share/doc/packages/doxygen" CACHE STRING "Relative path where to install the documentation")
87 file(GLOB LANG_FILES "${TOP}/src/translator_??.h")
89 file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man
90 ${PROJECT_BINARY_DIR}/src
91 ${PROJECT_BINARY_DIR}/doc)
93 file(COPY ${TOP}/VERSION DESTINATION ${PROJECT_BINARY_DIR}/)
94 file(COPY ${TOP}/src/translator.h DESTINATION ${PROJECT_BINARY_DIR}/src/)
95 file(COPY ${TOP}/src/translator_adapter.h DESTINATION ${PROJECT_BINARY_DIR}/src/)
96 file(COPY ${LANG_FILES} DESTINATION ${PROJECT_BINARY_DIR}/src/)
98 foreach (f ${DOC_FILES})
99 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${f}
100 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/
101 DEPENDS ${CMAKE_SOURCE_DIR}/doc/${f}
103 set_source_files_properties(${PROJECT_BINARY_DIR}/doc/${f} PROPERTIES GENERATED 1)
104 list(APPEND OUT_DOC_FILES "${PROJECT_BINARY_DIR}/doc/${f}")
107 configure_file(${CMAKE_SOURCE_DIR}/doc/manual.sty ${PROJECT_BINARY_DIR}/doc/manual.sty)
108 configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen_manual.tex ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex)
109 configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen.1 ${PROJECT_BINARY_DIR}/man/doxygen.1)
110 configure_file(${CMAKE_SOURCE_DIR}/doc/doxywizard.1 ${PROJECT_BINARY_DIR}/man/doxywizard.1)
111 configure_file(${CMAKE_SOURCE_DIR}/doc/doxysearch.1 ${PROJECT_BINARY_DIR}/man/doxysearch.1)
112 configure_file(${CMAKE_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR}/man/doxyindexer.1)
114 # doc/language.doc (see tag Doxyfile:INPUT)
116 COMMAND ${PYTHON_EXECUTABLE} translator.py
117 DEPENDS ${PROJECT_BINARY_DIR}/doc/maintainers.txt ${PROJECT_BINARY_DIR}/doc/language.tpl ${PROJECT_BINARY_DIR}/doc/translator.py
119 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc
121 set_source_files_properties(language.doc PROPERTIES GENERATED 1)
123 # doc/config.doc (see tag Doxyfile:INPUT)
125 COMMAND ${PYTHON_EXECUTABLE} ${TOP}/src/configgen.py -doc ${TOP}/src/config.xml > config.doc
126 DEPENDS ${TOP}/src/config.xml ${TOP}/src/configgen.py
128 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/
130 set_source_files_properties(config.doc PROPERTIES GENERATED 1)
131 ################################################################################
132 add_custom_target(run_doxygen
133 COMMENT "Generating Latex and HTML documentation."
134 COMMAND ${DOXYGEN_EXECUTABLE}
135 DEPENDS ${PROJECT_BINARY_DIR}/doc/language.doc ${PROJECT_BINARY_DIR}/doc/config.doc
136 DEPENDS ${OUT_DOC_FILES}
139 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/
142 add_custom_target(doxygen_pdf
143 COMMENT "Generating Doxygen Manual PDF."
144 COMMAND ${CMAKE_COMMAND} -E remove refman.tex
145 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex .
146 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc/manual.sty .
147 COMMAND ${EPSTOPDF} ${CMAKE_SOURCE_DIR}/doc/doxygen_logo.eps --outfile=doxygen_logo.pdf
148 COMMAND ${PDFLATEX} -shell-escape doxygen_manual.tex
149 COMMAND ${MAKEINDEX} doxygen_manual.idx
150 COMMAND ${PDFLATEX} -shell-escape doxygen_manual.tex
152 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/latex
154 add_custom_target(docs
155 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/doxygen_logo.gif ${PROJECT_BINARY_DIR}/html/
156 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/doxygen_logo_low.gif ${PROJECT_BINARY_DIR}/html/
157 DEPENDS ${PROJECT_BINARY_DIR}/man/doxygen.1
158 ${PROJECT_BINARY_DIR}/man/doxywizard.1
159 ${PROJECT_BINARY_DIR}/man/doxysearch.1
160 ${PROJECT_BINARY_DIR}/man/doxyindexer.1
165 ################################################################################
167 "${PROJECT_BINARY_DIR}/man/doxygen.1"
168 "${PROJECT_BINARY_DIR}/man/doxywizard.1"
169 "${PROJECT_BINARY_DIR}/man/doxysearch.1"
170 "${PROJECT_BINARY_DIR}/man/doxyindexer.1"
171 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
175 "${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf"
176 DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
180 "${PROJECT_BINARY_DIR}/html"
181 DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"