Merge remote-tracking branch 'origin/topic/neverlord/select-cmake'

* origin/topic/neverlord/select-cmake:
  Fix check for cmake commands on POSIX shells
  Prefer cmake3 command, add --cmake=PATH option
This commit is contained in:
Johanna Amann 2019-10-21 11:42:18 +02:00
commit 50f7969e15
3 changed files with 25 additions and 12 deletions

View file

@ -1,4 +1,8 @@
3.1.0-dev.195 | 2019-10-21 11:42:18 +0200
* Prefer cmake3 command, add --cmake=PATH option (Dominik Charousset, Corelight)
3.1.0-dev.192 | 2019-10-17 16:32:16 -0700
* Zeekctl: change gzip compression level from 9 to default #614 (JC Connell)

View file

@ -1 +1 @@
3.1.0-dev.192
3.1.0-dev.195

31
configure vendored
View file

@ -4,19 +4,11 @@
set -e
command="$0 $*"
# check for `cmake` command
type cmake > /dev/null 2>&1 || {
echo "\
This package requires CMake, please install it first, then you may
use this configure script to access CMake equivalent functionality.\
" >&2;
exit 1;
}
usage="\
Usage: $0 [OPTION]... [VAR=VALUE]...
Build Options:
--cmake=PATH custom path to a CMake binary
--builddir=DIR place build files in directory [build]
--build-dir=DIR alias for --builddir
--build-type=TYPE set CMake build type [RelWithDebInfo]:
@ -169,6 +161,9 @@ while [ $# -ne 0 ]; do
echo "${usage}" 1>&2
exit 1
;;
--cmake=*)
CMakeCommand=$optarg
;;
--builddir=*)
builddir=$optarg
;;
@ -338,6 +333,20 @@ while [ $# -ne 0 ]; do
shift
done
if [ -z "$CMakeCommand" ]; then
# prefer cmake3 over "regular" cmake (cmake == cmake2 on RHEL)
if command -v cmake3 >/dev/null 2>&1 ; then
CMakeCommand="cmake3"
elif command -v cmake >/dev/null 2>&1 ; then
CMakeCommand="cmake"
else
echo "This package requires CMake, please install it first."
echo "Then you may use this script to configure the CMake build."
echo "Note: pass --cmake=PATH to use cmake in non-standard locations."
exit 1;
fi
fi
if [ "$user_set_scriptdir" != "true" ]; then
append_cache_entry ZEEK_SCRIPT_INSTALL_PATH STRING $prefix/share/zeek
fi
@ -363,9 +372,9 @@ echo "Source Directory: $sourcedir"
cd $builddir
if [ -n "$CMakeGenerator" ]; then
cmake -G "$CMakeGenerator" $CMakeCacheEntries $sourcedir
"$CMakeCommand" -G "$CMakeGenerator" $CMakeCacheEntries $sourcedir
else
cmake $CMakeCacheEntries $sourcedir
"$CMakeCommand" $CMakeCacheEntries $sourcedir
fi
echo "# This is the command used to configure this build" > config.status