2009-02-13 14:43:01 +00:00
|
|
|
addCMakeParams()
|
2007-08-05 13:54:42 +00:00
|
|
|
{
|
2008-02-20 23:02:41 +00:00
|
|
|
addToSearchPath CMAKE_INCLUDE_PATH /include "" $1
|
|
|
|
addToSearchPath CMAKE_LIBRARY_PATH /lib "" $1
|
2009-02-13 14:43:01 +00:00
|
|
|
addToSearchPath CMAKE_MODULE_PATH /share/cmake-@majorVersion@/Modules "" $1
|
2007-08-05 13:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fixCmakeFiles()
|
|
|
|
{
|
2009-02-13 14:43:01 +00:00
|
|
|
local replaceArgs
|
|
|
|
echo "fixing cmake files"
|
2008-02-20 23:02:41 +00:00
|
|
|
replaceArgs="-e -f -L -T /usr /FOO"
|
2009-02-13 14:43:01 +00:00
|
|
|
replaceArgs="$replaceArgs -a NO_DEFAULT_PATH \"\" -a NO_SYSTEM_PATH \"\""
|
2008-02-20 23:02:41 +00:00
|
|
|
find $1 -type f -name "*.cmake" | xargs replace-literal ${replaceArgs}
|
2007-08-05 13:54:42 +00:00
|
|
|
}
|
|
|
|
|
2009-02-13 14:43:01 +00:00
|
|
|
cmakeConfigurePhase()
|
2007-08-05 13:54:42 +00:00
|
|
|
{
|
2009-02-13 14:43:01 +00:00
|
|
|
eval "$preConfigure"
|
|
|
|
|
|
|
|
if test -z "$dontFixCmake"; then
|
2008-02-20 23:02:41 +00:00
|
|
|
fixCmakeFiles .
|
|
|
|
fi
|
|
|
|
|
2009-02-13 14:43:01 +00:00
|
|
|
if test -z "$dontUseCmakeBuildDir"; then
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmakeDir=..
|
2008-02-20 23:02:41 +00:00
|
|
|
fi
|
2009-02-13 14:43:01 +00:00
|
|
|
|
|
|
|
if test -z "$dontAddPrefix"; then
|
|
|
|
cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags"
|
2008-02-20 23:02:41 +00:00
|
|
|
fi
|
2007-08-05 13:54:42 +00:00
|
|
|
|
2009-02-13 14:43:01 +00:00
|
|
|
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
|
|
|
|
|
|
|
|
cmake ${cmakeDir:-.} $cmakeFlags ${cmakeFlagsArray[@]}
|
|
|
|
|
|
|
|
eval "$postConfigure"
|
|
|
|
}
|
2007-09-20 19:27:55 +00:00
|
|
|
|
2009-02-13 14:43:01 +00:00
|
|
|
if test -z "$dontUseCmakeConfigure"; then
|
|
|
|
configurePhase=cmakeConfigurePhase
|
|
|
|
fi
|
2007-08-05 13:54:42 +00:00
|
|
|
|
2009-02-13 14:43:01 +00:00
|
|
|
envHooks=(${envHooks[@]} addCMakeParams)
|