-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
147 lines (129 loc) · 3.41 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
## CMakeLists.txt:
##
## Copyright (C) 2016-2019 Christian Schenk
##
## This file is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; either version 2, or (at your
## option) any later version.
##
## This file is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this file; if not, write to the Free Software
## Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
cmake_minimum_required(VERSION 3.2.1 FATAL_ERROR)
project(miktex-testing LANGUAGES NONE)
enable_testing()
option(
DVI_COMPARE_VISUALLY
"Compare resulting DVI files visually with a test reference."
TRUE
)
option(
PDF_COMPARE_VISUALLY
"Compare resulting PDF files visually with a test reference."
TRUE
)
if(MIKTEX_BINARY_DIR)
set(bindir_guess ${MIKTEX_BINARY_DIR})
elseif(WIN32)
set(bindir_guess "C:/Program Files/MiKTeX 2.9")
else()
set(bindir_guess "/usr/local/bin")
endif()
set(miktex_executables
initexmf
miktex-bibtex
miktex-dvipng
miktex-dvips
miktex-dvisvgm
miktex-epstopdf
miktex-luahbtex
miktex-latex
miktex-lualatex
miktex-makeindex
miktex-mpost
miktex-pdflatex
miktex-pdftex
miktex-ps2pk
miktex-xelatex
)
foreach(exe ${miktex_executables})
string(REPLACE "-" "_" exe_ "${exe}")
string(TOUPPER "${exe_}" EXE)
find_program(${EXE}_EXECUTABLE
NAMES ${exe}
PATHS ${bindir_guess}
)
if(NOT ${EXE}_EXECUTABLE)
message(FATAL_ERROR "The MiKTeX executable ${exe} does no exist.")
endif()
endforeach()
set(script_wrappers
htlatex
make4ht
)
#TODO:
#set(nodist_executables
# chunkdib
#)
foreach(exe ${script_wrappers} ${nodist_executables})
string(TOUPPER "${exe}" EXE)
find_program(${EXE}_EXECUTABLE
NAMES ${exe}
PATHS ${bindir_guess}
)
endforeach()
set(required_programs
diff
gzip
md5sum
pdfinfo
pdftoppm
touch
unzip
)
if(EXISTS ${CHUNKDIB_EXECUTABLE})
list(APPEND required_programs
convert
)
endif()
foreach(exe ${required_programs})
string(TOUPPER "${exe}" EXE)
find_program(${EXE}_EXECUTABLE
NAMES ${exe}
PATHS ${bindir_guess}
)
if(NOT ${EXE}_EXECUTABLE)
message(FATAL_ERROR "The program ${exe} could not be found.")
endif()
endforeach()
set(EXTRA_LONG_DIRECTORY_PATH_WITH_SPACES "${CMAKE_BINARY_DIR}/extra long path with spaces")
foreach(n RANGE 1 20)
set(EXTRA_LONG_DIRECTORY_PATH_WITH_SPACES "${EXTRA_LONG_DIRECTORY_PATH_WITH_SPACES}/extra long path with spaces ${n}")
endforeach()
make_directory("${EXTRA_LONG_DIRECTORY_PATH}")
add_test(initexmf-report ${INITEXMF_EXECUTABLE} --report)
add_subdirectory(makeindex)
add_subdirectory(ps2pk)
add_subdirectory(dvips)
add_subdirectory(dvisvgm)
add_subdirectory(pdftex)
add_subdirectory(luatex)
add_subdirectory(xetex)
if(EXISTS ${HTLATEX_EXECUTABLE})
add_subdirectory(tex4ht)
endif()
if(EXISTS ${CHUNKDIB_EXECUTABLE})
add_subdirectory(chunkdib)
endif()
add_subdirectory(bibtex)
add_subdirectory(synctex)
add_subdirectory(epstopdf)
add_subdirectory(mpost)
#add_subdirectory(luahbtex)