cmake: set BUILD_TESTING=OFF when doCheck is false

This means we can avoid building test suites that will never be run.
This commit is contained in:
Matthew Bauer 2019-02-21 20:21:31 -05:00
parent 3ea5f97ac4
commit 91f0c848f4

View File

@ -71,6 +71,11 @@ cmakeConfigurePhase() {
cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
# Dont build tests when doCheck = false
if [ -z "$doCheck" ]; then
cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags"
fi
# Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"