summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
blob: b834c66f7e49ddff11d64e4f3a31cf5d3c44ddb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if (build_doc)

find_program(EPSTOPDF NAMES epstopdf )
find_program(SED NAMES sed )
find_program(MAKE NAMES make gmake )

file(GLOB DOC_FILES "*")
file(COPY ${DOC_FILES}   DESTINATION ${DOXYDOCS})
file(COPY ${EXAMPLE_DIR} DESTINATION ${PROJECT_BINARY_DIR})

file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man)

add_custom_target(docs
	COMMENT "Generating documentation in ${DOXYDOCS}"
	COMMAND ${EXECUTABLE_OUTPUT_PATH}/doxygen
	COMMAND ${CMAKE_COMMAND} -E remove_directory ../latex/refman.tex
	COMMAND ${CMAKE_COMMAND} -E copy doxygen_logo.gif ../html
	COMMAND ${CMAKE_COMMAND} -E copy doxygen_logo_low.gif ../html
	COMMAND ${CMAKE_COMMAND} -E copy Makefile.latex ../latex/Makefile
	COMMAND ${SED} -e "s/\$VERSION/${VERSION}/g" doxygen_manual.tex > ../latex/doxygen_manual.tex
	COMMAND ${SED} -e "s/\$VERSION/${VERSION}/g" doxygen.sty > ../latex/doxygen.sty
	COMMAND ${EPSTOPDF} doxygen_logo.eps --outfile=../latex/doxygen_logo.pdf
        COMMAND ${MAKE} -C ../latex
	DEPENDS doxygen language.doc config.doc
                "${PROJECT_BINARY_DIR}/man/doxygen.1"
                "${PROJECT_BINARY_DIR}/man/doxywizard.1"
                "${PROJECT_BINARY_DIR}/man/doxysearch.1"
                "${PROJECT_BINARY_DIR}/man/doxyindexer.1"
	WORKING_DIRECTORY ${DOXYDOCS}
	VERBATIM
	)

# language.doc
add_custom_command(
        COMMAND ${CMAKE_COMMAND} "-DSOURCE=${CMAKE_SOURCE_DIR}" -P ${CMAKE_SOURCE_DIR}/cmake/run_translator.cmake
	DEPENDS ${DOXYDOCS}/translator.py
	DEPENDS maintainers.txt language.tpl translator.py
	OUTPUT language.doc
	WORKING_DIRECTORY ${DOXYDOCS}
)
set_source_files_properties(${DOXYDOCS}/language.doc PROPERTIES GENERATED 1)

# config.doc
add_custom_command(
	COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -doc ${CMAKE_SOURCE_DIR}/src/config.xml > config.doc
	DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py
	OUTPUT config.doc
	WORKING_DIRECTORY ${DOXYDOCS}
)
set_source_files_properties(${DOXYDOCS}/config.doc PROPERTIES GENERATED 1)

string(TIMESTAMP TODAY "%d-%m-%Y")

add_custom_command(
	COMMAND ${SED} -e "s/DATE/${TODAY}/g" -e "s/VERSION/${VERSION}/g" doxygen.1 > "${PROJECT_BINARY_DIR}/man/doxygen.1"
        OUTPUT "${PROJECT_BINARY_DIR}/man/doxygen.1"
)

add_custom_command(
	COMMAND ${SED} -e "s/DATE/${TODAY}/g" -e "s/VERSION/${VERSION}/g" doxywizard.1 > "${PROJECT_BINARY_DIR}/man/doxywizard.1"
        OUTPUT "${PROJECT_BINARY_DIR}/man/doxywizard.1"
)

add_custom_command(
	COMMAND ${SED} -e "s/DATE/${TODAY}/g" -e "s/VERSION/${VERSION}/g" doxysearch.1 > "${PROJECT_BINARY_DIR}/man/doxysearch.1"
        OUTPUT "${PROJECT_BINARY_DIR}/man/doxysearch.1"
)

add_custom_command(
	COMMAND ${SED} -e "s/DATE/${TODAY}/g" -e "s/VERSION/${VERSION}/g" doxyindexer.1 > "${PROJECT_BINARY_DIR}/man/doxyindexer.1"
        OUTPUT "${PROJECT_BINARY_DIR}/man/doxyindexer.1"
)

install(FILES
        "${PROJECT_BINARY_DIR}/man/doxygen.1"
        "${PROJECT_BINARY_DIR}/man/doxywizard.1"
        "${PROJECT_BINARY_DIR}/man/doxysearch.1"
        "${PROJECT_BINARY_DIR}/man/doxyindexer.1"
        DESTINATION man/man1
)

install(FILES
        "${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf"
        DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
)

install(DIRECTORY
        "${PROJECT_BINARY_DIR}/examples"
        "${PROJECT_BINARY_DIR}/html"
        DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
)

endif()