-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (29 loc) · 1.07 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
cmake_minimum_required (VERSION 3.13.0)
project (GeographicLib-Documentation NONE)
find_program (SPHINX sphinx-build REQUIRED)
find_program (RSYNC rsync)
add_subdirectory (geodesic-papers)
add_subdirectory (misc)
add_subdirectory (source)
set (BINARY_EXT "gif|pdf|png|kmz")
add_custom_target (checktrailingspace
COMMAND git ls-files |
grep -E -v '\\.\(${BINARY_EXT}\)$$' |
xargs grep '[ \t]$$' || true
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Looking for trailing spaces")
add_custom_target (checktabs
COMMAND git ls-files |
grep -E -v '\\.\(${BINARY_EXT}\)$$' |
xargs grep '\t' || true
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Looking for tabs")
add_custom_target (checkblanklines
COMMAND git ls-files |
grep -E -v '\\.\(${BINARY_EXT}\)$$' |
while read f\; do tr 'X\\n' 'YX' < $$f |
grep -E '\(^X|XXX|XX$$|[^X]$$\)' > /dev/null && echo $$f\; done || true
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Looking for extra blank lines")
add_custom_target (sanitize)
add_dependencies (sanitize checktrailingspace checktabs checkblanklines)