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>
This commit is contained in:
Kai Koehne 2020-10-07 16:47:42 +02:00
parent 0cb0119f43
commit ab4acdbeb1

View File

@ -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)