diff --git a/CHANGES b/CHANGES index d2be13082b..61e68d8c51 100644 --- a/CHANGES +++ b/CHANGES @@ -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) diff --git a/VERSION b/VERSION index a65ba83505..96d1c167b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.0-dev.192 +3.1.0-dev.195 diff --git a/configure b/configure index b40fb9fd3d..be22b4b477 100755 --- a/configure +++ b/configure @@ -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