2007-08-05 13:54:42 +00:00
|
|
|
addCMakeParamsInclude()
|
|
|
|
{
|
2007-11-12 13:51:46 +00:00
|
|
|
if [ -d $1/include ]; then
|
|
|
|
export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH}${CMAKE_INCLUDE_PATH:+:}$1/include"
|
|
|
|
fi
|
2007-08-05 13:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
addCMakeParamsLibs()
|
|
|
|
{
|
2007-11-12 13:51:46 +00:00
|
|
|
if [ -d $1/lib ]; then
|
|
|
|
export CMAKE_LIBRARY_PATH="${CMAKE_LIBRARY_PATH}${CMAKE_LIBRARY_PATH:+:}$1/lib"
|
|
|
|
fi
|
2007-08-05 13:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fixCmakeFiles()
|
|
|
|
{
|
2007-09-20 19:27:55 +00: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 14:48:09 +00:00
|
|
|
find $1 -type f -name "*.cmake" | xargs replace-literal ${replaceArgs}
|
2007-08-05 13:54:42 +00: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 19:27:55 +00:00
|
|
|
fi
|
|
|
|
if [ -z "$dontAddPrefix" ]; then
|
|
|
|
dontAddPrefix=1
|
2007-08-05 13:54:42 +00:00
|
|
|
configureFlags="-DCMAKE_INSTALL_PREFIX=$out $configureFlags"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2007-09-20 19:27:55 +00:00
|
|
|
|
2007-08-05 13:54:42 +00:00
|
|
|
if [ -z "$noCmakeTewaks" ]; then
|
2007-09-20 19:27:55 +00:00
|
|
|
postUnpack="cmakePostUnpack${postUnpack:+; }${postUnpack}"
|
2007-08-05 13:54:42 +00:00
|
|
|
fi;
|
|
|
|
|
2007-11-12 13:51:46 +00:00
|
|
|
envHooks=(${envHooks[@]} addCMakeParamsInclude addCMakeParamsLibs)
|