-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathCMakeLists.txt
100 lines (73 loc) · 2.56 KB
/
CMakeLists.txt
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
94
95
96
97
98
99
100
set(LIST
"abstract.txt"
"start_presentation.txt"
"middle_presentation.txt"
"end_presentation.txt"
"workshop_abstract.txt"
)
foreach (f ${LIST} )
if (OSGeoLiveDoc_VERBOSE_DEBUG)
message(STATUS " Adding file ${f}")
endif()
configure_file("${f}" "${f}")
endforeach()
#---------------------------------------------
# Adding the sphinx subdirectories and files
#---------------------------------------------
configure_file("conf.py" "revealjs/conf.py" @ONLY)
#---------------------------------------------
# Adding the scripts and executing
#---------------------------------------------
add_subdirectory(scripts)
add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/revealjs/presentation.rst"
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/scripts/build_presentation.pl
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/start_presentation.txt
${CMAKE_CURRENT_BINARY_DIR}/middle_presentation.txt
${CMAKE_CURRENT_BINARY_DIR}/end_presentation.txt
${CMAKE_CURRENT_BINARY_DIR}/scripts/build_presentation.pl
${CMAKE_SOURCE_DIR}/projects_info.csv
)
if (LOCALE)
add_custom_target(p-locale
COMMAND ${SPHINX_EXECUTABLE}
-b gettext
# the location of the documentation to be build
"${CMAKE_CURRENT_BINARY_DIR}/revealjs"
"${CMAKE_SOURCE_DIR}/locale/pot"
COMMAND sphinx-intl update -d ${CMAKE_SOURCE_DIR}/locale -l en >> locale_changes.txt
#COMMAND sphinx-intl update-txconfig-resources
#--locale-dir ${CMAKE_SOURCE_DIR}/locale
#--pot-dir ${CMAKE_SOURCE_DIR}/locale/pot
#--transifex-project-name osgeolive > /dev/null
DEPENDS revealjs/presentation.rst
COMMENT "Generating POT & PO files ..."
)
add_dependencies(locale p-locale)
return()
endif()
add_custom_target(presentation ALL
COMMENT "Building presentation with Sphinx")
message(STATUS "CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}")
# Presentation is only revealjs
foreach (target ${OSGeoLiveDoc_DOC_TARGETS})
foreach (lang ${OSGeoLiveDoc_BUILD_LANGUAGES})
add_custom_target(
"presentation-${target}-${lang}"
COMMAND ${SPHINX_EXECUTABLE}
-M revealjs
#-c "${CMAKE_CURRENT_BINARY_DIR}"
-Dlanguage='${lang}'
# the location of the presentation to be build
"."
# where the presentation is written
"${SPHINX_BUILD_DIR}/${target}/${lang}"
DEPENDS revealjs/presentation.rst
COMMENT "Generating presentation/${lang} documentation ..."
)
add_dependencies("presentation" "presentation-${target}-${lang}")
endforeach()
endforeach()
add_dependencies(doc presentation)