Allow CMake program to be specified with env. var.

If you are using a custom CMake, you should be able to set the
environment variable "CMAKE" and have the configure script pick up
the default from there so that you don't have to specify the option
every time.
This commit is contained in:
Roland Kaufmann
2013-02-15 09:31:13 +01:00
parent 4fc2593bb3
commit be26e078d2

15
configure vendored
View File

@@ -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}