From ab4acdbeb116d203abfcbb60e390775230033303 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 7 Oct 2020 16:47:42 +0200 Subject: 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 --- cmake/QtProcessConfigureArgs.cmake | 42 +++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'cmake') 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) -- cgit v1.2.3