-
Notifications
You must be signed in to change notification settings - Fork 353
/
config-gmt-unix.sh
executable file
·46 lines (36 loc) · 1.04 KB
/
config-gmt-unix.sh
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
#!/usr/bin/env bash
# Configure GMT setting under UNIX
# To return a failure if any commands inside fail
set -e
cat > cmake/ConfigUser.cmake << 'EOF'
set (CMAKE_INSTALL_PREFIX "$ENV{INSTALLDIR}")
set (GSHHG_ROOT "$ENV{COASTLINEDIR}/gshhg")
set (DCW_ROOT "$ENV{COASTLINEDIR}/dcw")
set (GMT_USE_THREADS TRUE)
set (GMT_ENABLE_OPENMP TRUE)
# Always use the 'static' data server in CI.
set (GMT_DATA_SERVER static)
# recommended even for release build
set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement ${CMAKE_C_FLAGS}")
# extra warnings
set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")
EOF
if [[ "$RUN_TESTS" == "true" ]]; then
cat >> cmake/ConfigUser.cmake << 'EOF'
set (CMAKE_BUILD_TYPE Debug)
enable_testing()
set (DO_EXAMPLES TRUE)
set (DO_TESTS TRUE)
set (DO_API_TESTS ON)
set (DO_SUPPLEMENT_TESTS ON)
set (SUPPORT_EXEC_IN_BINARY_DIR TRUE)
# For code coverage
set (CMAKE_C_FLAGS "--coverage -O0 ${CMAKE_C_FLAGS}")
EOF
fi
echo ""
echo "Using the following cmake configuration:"
cat cmake/ConfigUser.cmake
echo ""
# Turn off exit on failure.
set +e