-
Notifications
You must be signed in to change notification settings - Fork 548
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (50 loc) · 2.11 KB
/
CMakeLists.txt
File metadata and controls
59 lines (50 loc) · 2.11 KB
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
include(Version)
set(AF_DOCS_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/doxygen.mk")
set(AF_DOCS_CONFIG_OUT "${CMAKE_CURRENT_BINARY_DIR}/doxygen.mk.out")
set(AF_DOCS_LAYOUT "${CMAKE_CURRENT_SOURCE_DIR}/layout.xml")
set(AF_DOCS_LAYOUT_OUT "${CMAKE_CURRENT_BINARY_DIR}/layout.xml.out")
set(DOCS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
set(EXAMPLES_DIR "${PROJECT_SOURCE_DIR}/examples")
set(SNIPPETS_DIR "${PROJECT_SOURCE_DIR}/test")
configure_file(${AF_DOCS_CONFIG} ${AF_DOCS_CONFIG_OUT})
configure_file(${AF_DOCS_LAYOUT} ${AF_DOCS_LAYOUT_OUT})
###########################################################
## This generates a list of the examples cpp files and
## creates a dox file under docs/details/examples.dox
## This is used to generate documentation for examples
###########################################################
file(GLOB EXAMPLES_CPP
"${EXAMPLES_DIR}/*/*.cpp")
# Sort alphabetically
# Note: example directories will be major sort order
list(SORT EXAMPLES_CPP)
# Get filenames and write to a string
foreach(SRC ${EXAMPLES_CPP})
get_filename_component(DIR_PATH ${SRC} DIRECTORY)
get_filename_component(DIR_NAME ${DIR_PATH} NAME)
get_filename_component(SRC_NAME ${SRC} NAME)
set(EXAMPLES_LIST "${EXAMPLES_LIST}\\example ${DIR_NAME}/${SRC_NAME}\n")
endforeach(SRC ${EXAMPLES_CPP})
# Write string containing file names to examples.dox
configure_file(
${PROJECT_SOURCE_DIR}/CMakeModules/examples.dox.in
${DOCS_DIR}/details/examples.dox
)
###########################################################
add_custom_target(docs
ALL
COMMAND Doxygen::doxygen ${AF_DOCS_CONFIG_OUT}
COMMAND cmake -E copy_directory ${ASSETS_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Documentation"
VERBATIM)
# Install Doxygen documentation
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${AF_INSTALL_DOC_DIR}
COMPONENT documentation
PATTERN ".git" EXCLUDE
)
# Install man pages
#install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man DESTINATION ${AF_INSTALL_MAN_DIR}
# COMPONENT documentation
#)