2007-08-05 15:54:42 +02:00
|
|
|
addCMakeParamsInclude()
|
|
|
|
{
|
|
|
|
if [ -d $1/include ]; then
|
|
|
|
export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH}${CMAKE_INCLUDE_PATH:+:}$1/include"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
addCMakeParamsLibs()
|
|
|
|
{
|
|
|
|
if [ -d $1/lib ]; then
|
|
|
|
export CMAKE_LIBRARY_PATH="${CMAKE_LIBRARY_PATH}${CMAKE_LIBRARY_PATH:+:}$1/lib"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
fixCmakeFiles()
|
|
|
|
{
|
2007-09-20 21:27:55 +02:00
|
|
|
local replaceArgs;
|
|
|
|
echo "Fixing cmake files"
|
|
|
|
replaceArgs="-e -f -L -T /usr /FOO"
|
|
|
|
replaceArgs="${replaceArgs} -a NO_DEFAULT_PATH \"\" -a NO_SYSTEM_PATH \"\""
|
2007-09-27 16:48:09 +02:00
|
|
|
find $1 -type f -name "*.cmake" | xargs replace-literal ${replaceArgs}
|
2007-08-05 15:54:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cmakePostUnpack()
|
|
|
|
{
|
|
|
|
sourceRoot=$sourceRoot/build
|
|
|
|
mkdir -v $sourceRoot
|
|
|
|
echo source root reset to $sourceRoot
|
|
|
|
|
|
|
|
if [ -z "$dontFixCmake" ]; then
|
|
|
|
fixCmakeFiles .
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$configureScript" ]; then
|
|
|
|
configureScript="cmake .."
|
2007-09-20 21:27:55 +02:00
|
|
|
fi
|
|
|
|
if [ -z "$dontAddPrefix" ]; then
|
|
|
|
dontAddPrefix=1
|
2007-08-05 15:54:42 +02:00
|
|
|
configureFlags="-DCMAKE_INSTALL_PREFIX=$out $configureFlags"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2007-09-20 21:27:55 +02:00
|
|
|
|
2007-08-05 15:54:42 +02:00
|
|
|
if [ -z "$noCmakeTewaks" ]; then
|
2007-09-20 21:27:55 +02:00
|
|
|
postUnpack="cmakePostUnpack${postUnpack:+; }${postUnpack}"
|
2007-08-05 15:54:42 +02:00
|
|
|
fi;
|
|
|
|
|
|
|
|
envHooks=(${envHooks[@]} addCMakeParamsInclude addCMakeParamsLibs)
|