diff options
author | Kai Koehne <kai.koehne@qt.io> | 2020-10-07 16:47:42 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2020-10-08 11:12:30 +0000 |
commit | ab4acdbeb116d203abfcbb60e390775230033303 (patch) | |
tree | a1381063fde8d7ec898a6a03a92af944a56fca9b /cmake | |
parent | 0cb0119f435c683136291a94eeb7010f30ff27db (diff) |
Do not build tests and examples by default for configure -cmake
Tests were never built by default, except for -developer-build.
Examples were build, but aren't anymore by default if you
run cmake directly.
Let the default be figured out by cmake, and only set
BUILD_EXAMPLES and BUILD_TESTING if the user has
expicitly passed them via -make or -nomake.
Task-number: QTBUG-87217
Change-Id: I37321d96cc1e9e184a711a858c860b0205d5b74f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 2189f1dbd5..402ca52b24 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -603,24 +603,34 @@ translate_string_input(android-javac-target QT_ANDROID_JAVAC_TARGET) drop_input(make) drop_input(nomake) -set(build_parts libs tests examples tools ${INPUT_make}) -list(REMOVE_DUPLICATES build_parts) + foreach(part ${INPUT_nomake}) - list(REMOVE_ITEM build_parts ${part}) + if("${part}" STREQUAL "tests") + push("-DBUILD_TESTING=OFF") + continue() + endif() + if("${part}" STREQUAL "examples") + push("-DBUILD_EXAMPLES=OFF") + continue() + endif() + qtConfAddWarning("'-nomake ${part}' is not implemented yet.") +endforeach() + +foreach(part ${INPUT_make}) + if("${part}" STREQUAL "tests") + push("-DBUILD_TESTING=ON") + continue() + endif() + if("${part}" STREQUAL "examples") + push("-DBUILD_EXAMPLES=ON") + continue() + endif() + if("${part}" STREQUAL "tools") + # default + continue() + endif() + qtConfAddWarning("'-make ${part}' is not implemented yet.") endforeach() -if("tests" IN_LIST build_parts) - push("-DBUILD_TESTING=ON") -else() - push("-DBUILD_TESTING=OFF") -endif() -if("examples" IN_LIST build_parts) - push("-DBUILD_EXAMPLES=ON") -else() - push("-DBUILD_EXAMPLES=OFF") -endif() -if(NOT "tools" IN_LIST build_parts) - qtConfAddWarning("'-nomake tools' is not implemented yet.") -endif() drop_input(debug) drop_input(release) |