Extracts the full compiler path and feeds it to cmake.

Previously, specifying the compiler name with a variable
to configure ("configure CC=gcc") lead to CMake complaining
that <builddir>/$CC was not a valid path. This patch fixes
this by extracting the full path with "which <compiler>".
Should fix issue #355.
This commit is contained in:
Markus Blatt
2013-09-02 18:03:05 +02:00
committed by Bård Skaflestad
parent 7d86ae5453
commit 23499b7616

View File

@@ -453,11 +453,11 @@ for a in "${VARS[@]}"; do
;;
CC=*)
# special processing for compiler options
a=${a#CC=}
a=`which ${a#CC=}`
c_compiler=" -DCMAKE_C_COMPILER=\"${a/\"/\\\"}\""
;;
CXX=*)
a=${a#CXX=}
a=`which ${a#CXX=}`
cxx_compiler=" -DCMAKE_CXX_COMPILER=\"${a/\"/\\\"}\""
;;
CFLAGS=*)
@@ -469,7 +469,7 @@ for a in "${VARS[@]}"; do
cxx_opts=" -DCMAKE_CXX_FLAGS=\"${a/\"/\\\"}\""
;;
FC=*)
a=${a#FC=}
a=`which ${a#FC=}`
fort_compiler=" -DCMAKE_Fortran_COMPILER=\"${a/\"/\\\"}\""
;;
FFLAGS=*)