1#!/usr/bin/env bash 2# Configure GMT settings under Windows 3 4# To return a failure if any commands inside fail 5set -e 6 7cat > cmake/ConfigUser.cmake << 'EOF' 8set (CMAKE_INSTALL_PREFIX "$ENV{INSTALLDIR}") 9set (GSHHG_ROOT "$ENV{COASTLINEDIR}/gshhg") 10set (DCW_ROOT "$ENV{COASTLINEDIR}/dcw") 11 12set (GMT_ENABLE_OPENMP TRUE) 13EOF 14 15if [[ "$RUN_TESTS" == "true" ]]; then 16 cat >> cmake/ConfigUser.cmake << 'EOF' 17enable_testing() 18set (DO_EXAMPLES TRUE) 19set (DO_TESTS TRUE) 20set (DO_API_TESTS ON) 21set (SUPPORT_EXEC_IN_BINARY_DIR TRUE) 22 23# Turn on testing of upcoming long-option syntax for common GMT options 24add_definitions(-DUSE_COMMON_LONG_OPTIONS) 25# Turn on testing of upcoming long-option syntax for module options 26add_definitions(-DUSE_MODULE_LONG_OPTIONS) 27EOF 28fi 29 30echo "" 31echo "Using the following cmake configuration:" 32cat cmake/ConfigUser.cmake 33echo "" 34 35# Turn off exit on failure. 36set +e 37