Debian Codegraph @

contrib/depends/patches/qt/root_CMakeLists.txt

raw
1 # The real minimum version will be checked by the qtbase project.
2 # 3.16 is the absolute minimum though.
3 cmake_minimum_required(VERSION 3.16...3.20)
4
5 # Include qtbase's .cmake.conf for access to QT_REPO_MODULE_VERSION
6 set(__qt6_qtbase_src_path "${CMAKE_CURRENT_SOURCE_DIR}/qtbase")
7 include("${__qt6_qtbase_src_path}/.cmake.conf")
8
9 # Run platform auto-detection /before/ the first project() call and thus
10 # before the toolchain file is loaded.
11 include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
12
13 project(Qt
14 VERSION "${QT_REPO_MODULE_VERSION}"
15 DESCRIPTION "Qt Libraries"
16 HOMEPAGE_URL "https://qt.io/"
17 LANGUAGES CXX C ASM
18 )
19
20 # Required so we can call ctest from the root build directory
21 enable_testing()
22
23 set(qt_module_prop_prefix "__qt_prop_")
24
25 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
26 list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake")
27 list(APPEND CMAKE_MODULE_PATH
28 "${__qt6_qtbase_src_path}/cmake/3rdparty/extra-cmake-modules/find-modules")
29 list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake/3rdparty/kwin")
30
31 # Also make sure the CMake config files do not recreate the already-existing targets
32 set(QT_NO_CREATE_TARGETS TRUE)
33 set(QT_SUPERBUILD TRUE)
34
35 set(QT_BUILD_SUBMODULES "qtbase;qtsvg;qtwebsockets;qtshadertools;qtmultimedia;qtwayland" CACHE STRING "Submodules to build")
36
37 foreach(module IN LISTS QT_BUILD_SUBMODULES)
38 message(NOTICE "Configuring '${module}'")
39 add_subdirectory("${module}")
40
41 if(module STREQUAL "qtbase")
42 list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/lib/cmake")
43 list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
44 endif()
45 endforeach()
46
47 # Display a summary of everything
48 include(QtBuildInformation)
49 include(QtPlatformSupport)
50 qt_print_feature_summary()
51 qt_print_build_instructions()