cmake/setup.sh: allow for cmakeBuildDir to be configured
This commit is contained in:
parent
0df46e6fd8
commit
3d17b4c305
1 changed files with 9 additions and 4 deletions
|
@ -15,6 +15,9 @@ fixCmakeFiles() {
|
||||||
cmakeConfigurePhase() {
|
cmakeConfigurePhase() {
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
|
# default to CMake defaults if unset
|
||||||
|
: ${cmakeBuildDir:=build}
|
||||||
|
|
||||||
export CTEST_OUTPUT_ON_FAILURE=1
|
export CTEST_OUTPUT_ON_FAILURE=1
|
||||||
if [ -n "${enableParallelChecking-1}" ]; then
|
if [ -n "${enableParallelChecking-1}" ]; then
|
||||||
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
|
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
|
||||||
|
@ -25,9 +28,11 @@ cmakeConfigurePhase() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${dontUseCmakeBuildDir-}" ]; then
|
if [ -z "${dontUseCmakeBuildDir-}" ]; then
|
||||||
mkdir -p build
|
mkdir -p "$cmakeBuildDir"
|
||||||
cd build
|
cd "$cmakeBuildDir"
|
||||||
cmakeDir=${cmakeDir:-..}
|
: ${cmakeDir:=..}
|
||||||
|
else
|
||||||
|
: ${cmakeDir:=.}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${dontAddPrefix-}" ]; then
|
if [ -z "${dontAddPrefix-}" ]; then
|
||||||
|
@ -118,7 +123,7 @@ cmakeConfigurePhase() {
|
||||||
|
|
||||||
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
|
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
|
||||||
|
|
||||||
cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"
|
cmake "$cmakeDir" $cmakeFlags "${cmakeFlagsArray[@]}"
|
||||||
|
|
||||||
if ! [[ -v enableParallelBuilding ]]; then
|
if ! [[ -v enableParallelBuilding ]]; then
|
||||||
enableParallelBuilding=1
|
enableParallelBuilding=1
|
||||||
|
|
Loading…
Reference in a new issue