summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/QtBuildInternalsExtra.cmake.in4
-rw-r--r--cmake/QtSetup.cmake3
3 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 938a6f98cb..a45098efbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,6 @@ qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs"
qt_build_repo_end()
-option(BUILD_EXAMPLES "Build Qt examples" ON)
-if (BUILD_EXAMPLES)
+if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in
index 165978e680..04a0998cf1 100644
--- a/cmake/QtBuildInternalsExtra.cmake.in
+++ b/cmake/QtBuildInternalsExtra.cmake.in
@@ -23,5 +23,9 @@ set(QT_WILL_INSTALL @QT_WILL_INSTALL@ CACHE BOOL
set(QT_SOURCE_TREE "@QT_SOURCE_TREE@" CACHE PATH
"A path to the source tree of the previously configured QtBase project." FORCE)
+# 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")
+
# Extra set of exported variables
@QT_EXTRA_BUILD_INTERNALS_VARS@
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 2958ba08cc..9095db4751 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -87,6 +87,9 @@ option(BUILD_TESTING "Build the testing tree." ${QT_BUILD_TESTING})
include(CTest)
enable_testing()
+# Set up building of examples.
+option(BUILD_EXAMPLES "Build Qt examples" ON)
+
## Define some constants to check for certain platforms, etc:
include(QtPlatformSupport)