n2n/scripts/cmake_all.sh
Hamish Coleman 028d6f9b07
Harmonise configuration defaults (#937)
* Ensure all options start off for cmake too

* Attempt to make the build time config logic in the cmake process match the makefile process

* Add a simple muscle memory helper for cmake

* Ask them what they are smoking, then tell them to put it out

* Avoid occasional stale package cache errors
2022-01-25 20:11:02 +00:00

32 lines
707 B
Bash
Executable File

#!/bin/bash
#
# Well, cmake might be approximately the same as ./configure && make, but it
# never rolls off the fingers as easily
#
if [ ! -f CMakeLists.txt ]; then
echo ERROR: run this script from the TOPDIR
exit 1
fi
OPTS=""
#OPTS+=-DN2N_OPTION_USE_ZSTD=ON
set -e
rm -rf build
cmake -E make_directory build
cd build
# Shell check wants me to use an array in this scenario. Bourne shell
# arrays are my line in the sand showing that a script should not be
# written in such a horrible language. Since it would be silly to rewrite
# a one-page wrapper script in python, we submit that this check is wrong.
# shellcheck disable=SC2086
cmake $OPTS ..
cmake --build . --config Release
ctest