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() {
|
||||
runHook preConfigure
|
||||
|
||||
# default to CMake defaults if unset
|
||||
: ${cmakeBuildDir:=build}
|
||||
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
if [ -n "${enableParallelChecking-1}" ]; then
|
||||
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
|
||||
|
@ -25,9 +28,11 @@ cmakeConfigurePhase() {
|
|||
fi
|
||||
|
||||
if [ -z "${dontUseCmakeBuildDir-}" ]; then
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmakeDir=${cmakeDir:-..}
|
||||
mkdir -p "$cmakeBuildDir"
|
||||
cd "$cmakeBuildDir"
|
||||
: ${cmakeDir:=..}
|
||||
else
|
||||
: ${cmakeDir:=.}
|
||||
fi
|
||||
|
||||
if [ -z "${dontAddPrefix-}" ]; then
|
||||
|
@ -118,7 +123,7 @@ cmakeConfigurePhase() {
|
|||
|
||||
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
|
||||
|
||||
cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"
|
||||
cmake "$cmakeDir" $cmakeFlags "${cmakeFlagsArray[@]}"
|
||||
|
||||
if ! [[ -v enableParallelBuilding ]]; then
|
||||
enableParallelBuilding=1
|
||||
|
|
Loading…
Reference in a new issue