aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKevin Funk <kfunk@kde.org>2019-06-06 22:42:18 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-18 21:26:20 +0100
commita59826003e2e361bbe1beb9c899afc2ca25bc736 (patch)
tree86ff52611693aeeeb1c8fd66d8a51d10a4844c5f /CMakeLists.txt
parent34bbbedb78de9686949ea533306fa4e6468f2b70 (diff)
Start the CMake superbuild
Also import and use ECMOptionalAddSubdirectory.cmake to add other module's as subdirectories, in case the directories exist. Additionally this module allows to disable the build of submodules by passing e.g. BUILD_qtsvg=OFF. This probably needs more though on how to hande the intermodule dependencies, but it's a start. Task-number: QTBUG-75582 Change-Id: Ic3de9711d9b865b2d96bdaee0089f570408b9693 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 7509458d5f1ed5a48285471e32eda333cc3eeb8c) Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..e54ec11a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.15.0)
+
+project(Qt
+ VERSION 6.0.0
+ DESCRIPTION "Qt Libraries"
+ HOMEPAGE_URL "https://qt.io/"
+ LANGUAGES CXX C ASM
+)
+
+# Required so we can call ctest from the root build directory
+enable_testing()
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+if (NOT QT_BUILD_STANDALONE_TESTS)
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/qtbase/cmake")
+endif()
+
+include(ECMOptionalAddSubdirectory)
+
+# Use the CMake config files from the binary dir
+list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
+# Also make sure the CMake config files do not recreate the already-existing targets
+if (NOT QT_BUILD_STANDALONE_TESTS)
+ set(QT_NO_CREATE_TARGETS TRUE)
+endif()
+set(QT_SUPERBUILD TRUE)
+
+# qtbase is always needed
+add_subdirectory(qtbase)
+
+if (NOT QT_BUILD_STANDALONE_TESTS)
+ list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}")
+endif()
+
+ecm_optional_add_subdirectory(qtconnectivty)
+ecm_optional_add_subdirectory(qtdeclarative)
+ecm_optional_add_subdirectory(qtgraphicaleffects)
+ecm_optional_add_subdirectory(qtimageformats)
+ecm_optional_add_subdirectory(qtsvg)
+ecm_optional_add_subdirectory(qtquickcontrols2)
+ecm_optional_add_subdirectory(qtgamepad)
+ecm_optional_add_subdirectory(qttools)
+
+
+if(NOT QT_BUILD_STANDALONE_TESTS)
+ # Display a summary of everything
+ include(QtBuildInformation)
+ qt_print_feature_summary()
+ qt_print_build_instructions()
+endif()