forked from ngscopeclient/scopehal-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
42 lines (40 loc) · 1.51 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
# Not all CMake Generators support file globbing, so build our tex dependency list manually
# We could get CMake to do the glob, but there's not many files to deal with
set(DOC_LIST
glscopeclient-manual.tex
section-copyright.tex
section-decodes.tex
section-scope-drivers.tex
section-powersupply-drivers.tex
section-exports.tex
section-gettingstarted.tex
section-grapheditor.tex
section-history.tex
section-internals.tex
section-legal.tex
section-mainwindow.tex
section-protoanalyzer.tex
section-revision.tex
section-timeline.tex
section-transports.tex
section-triggers.tex
section-waveformgroups.tex
section-waveformviews.tex
)
# Save ourselves from having to manually paste this in front of every filename
list(TRANSFORM DOC_LIST PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glscopeclient-manual.pdf
COMMAND pdflatex -halt-on-error -interaction batchmode
--output-directory ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/glscopeclient-manual.tex > ${CMAKE_CURRENT_BINARY_DIR}/run1.log 2>&1
COMMAND pdflatex -halt-on-error -interaction batchmode
--output-directory ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/glscopeclient-manual.tex > ${CMAKE_CURRENT_BINARY_DIR}/run2.log 2>&1
DEPENDS ${DOC_LIST}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM)
add_custom_target(doc ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glscopeclient-manual.pdf)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glscopeclient-manual.pdf
DESTINATION doc/glscopeclient)