diff --git a/configure b/configure index 853c06c6..b9db0033 100755 --- a/configure +++ b/configure @@ -53,6 +53,7 @@ Some influential environment variables: FFLAGS Fortran 77 compiler flags FC Fortran compiler command FCFLAGS Fortran compiler flags + CMAKE_COMMAND Executable used to run cmake scripts Use these variables to override the choices made by \`configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -90,10 +91,12 @@ option_check=yes FEATURES= # command that launches cmake; look for 2.8 if available -if which cmake28 >/dev/null 2>&1; then -CMAKE=cmake28 -else -CMAKE=cmake +if [ "${CMAKE_COMMAND}" = "" ]; then + if which cmake28 >/dev/null 2>&1; then + CMAKE_COMMAND=cmake28 + else + CMAKE_COMMAND=cmake + fi fi # long arguments are implemented by putting a dash character followed by @@ -121,7 +124,7 @@ while getopts -- ":-:" optchar; do # the parameter to this option is an executable program, so # skip the directory test in that case if [ "${pkgname}" = "cmake" ]; then - CMAKE="${pkgloc}" + CMAKE_COMMAND="${pkgloc}" break fi # expand to full path since CMake changes to source directory (!) @@ -268,7 +271,7 @@ shift $((OPTIND-1)) ENVVARS=${@/ACLOCAL_*=*/} # pass everything on to CMake -CMDLINE="env ${ENVVARS} ${CMAKE} \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}" +CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}" echo --- calling CMake for opm-core --- echo ${CMDLINE} eval exec ${CMDLINE}