summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake6
-rw-r--r--cmake/QtBuildInternalsExtra.cmake.in4
-rw-r--r--cmake/QtSetup.cmake2
4 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb3cedc953..2b92df6853 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,6 +62,9 @@ endif()
if(BUILD_TESTING)
add_subdirectory(tests)
+ if(QT_NO_MAKE_TESTS)
+ set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
endif()
if(NOT QT_BUILD_STANDALONE_TESTS)
@@ -81,4 +84,7 @@ qt_build_repo_end()
if(NOT QT_BUILD_STANDALONE_TESTS AND BUILD_EXAMPLES)
add_subdirectory(examples)
+ if(QT_NO_MAKE_EXAMPLES)
+ set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
endif()
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 1ff33dc706..eab9c5d955 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -139,6 +139,9 @@ macro(qt_build_repo)
if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
add_subdirectory(tests)
+ if(QT_NO_MAKE_TESTS)
+ set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
endif()
qt_build_repo_end()
@@ -147,6 +150,9 @@ macro(qt_build_repo)
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt"
AND NOT QT_BUILD_STANDALONE_TESTS)
add_subdirectory(examples)
+ if(QT_NO_MAKE_EXAMPLES)
+ set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
endif()
endmacro()
diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in
index 04a0998cf1..68e1271781 100644
--- a/cmake/QtBuildInternalsExtra.cmake.in
+++ b/cmake/QtBuildInternalsExtra.cmake.in
@@ -26,6 +26,10 @@ set(QT_SOURCE_TREE "@QT_SOURCE_TREE@" CACHE PATH
# Propagate decision of building tests and examples to other repositories.
set(BUILD_TESTING @BUILD_TESTING@ CACHE BOOL "Build the testing tree.")
set(BUILD_EXAMPLES @BUILD_EXAMPLES@ CACHE BOOL "Build Qt examples")
+set(QT_NO_MAKE_TESTS @QT_NO_MAKE_TESTS@ CACHE BOOL
+ "Should tests be built as part of the default 'all' target.")
+set(QT_NO_MAKE_EXAMPLES @QT_NO_MAKE_EXAMPLES@ CACHE BOOL
+ "Should examples be built as part of the default 'all' target.")
# Extra set of exported variables
@QT_EXTRA_BUILD_INTERNALS_VARS@
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 04b26d9596..f53388a27f 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -94,12 +94,14 @@ if(QT_BUILD_STANDALONE_TESTS)
# building standalone tests.
set(BUILD_TESTING ON CACHE BOOL "Build the testing tree." FORCE)
endif()
+option(QT_NO_MAKE_TESTS "Should tests be built as part of the default 'all' target." OFF)
include(CTest)
enable_testing()
# Set up building of examples.
option(BUILD_EXAMPLES "Build Qt examples" ON)
+option(QT_NO_MAKE_EXAMPLES "Should examples be built as part of the default 'all' target." OFF)
# Build Benchmarks
option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks})