2020-11-02 09:02:58 +01:00
|
|
|
set(__qt6_qtbase_src_path "${CMAKE_CURRENT_SOURCE_DIR}/qtbase")
|
|
|
|
|
2020-11-02 08:53:35 +01:00
|
|
|
include("${__qt6_qtbase_src_path}/.cmake.conf")
|
|
|
|
include("${__qt6_qtbase_src_path}/cmake/QtCMakeVersionHelpers.cmake")
|
|
|
|
qt_internal_check_for_suitable_cmake_version()
|
|
|
|
qt_internal_get_computed_minimum_cmake_version(__qt_minimum_cmake_version)
|
|
|
|
cmake_minimum_required(VERSION ${__qt_minimum_cmake_version})
|
2019-06-06 22:42:18 +02:00
|
|
|
|
2020-11-02 09:02:58 +01:00
|
|
|
include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
|
2020-10-09 11:50:41 +02:00
|
|
|
|
2019-06-06 22:42:18 +02:00
|
|
|
project(Qt
|
2021-01-07 11:56:34 +01:00
|
|
|
VERSION 6.1.0
|
2019-06-06 22:42:18 +02:00
|
|
|
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()
|
|
|
|
|
2020-01-08 17:04:43 +01:00
|
|
|
set(qt_module_prop_prefix "__qt_prop_")
|
|
|
|
|
2019-06-06 22:42:18 +02:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
if (NOT QT_BUILD_STANDALONE_TESTS)
|
2020-11-02 09:02:58 +01:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH
|
|
|
|
"${__qt6_qtbase_src_path}/cmake/3rdparty/extra-cmake-modules/find-modules")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake/3rdparty/kwin")
|
2019-06-06 22:42:18 +02:00
|
|
|
endif()
|
|
|
|
|
2020-11-08 14:28:12 +01:00
|
|
|
include("QtTopLevelHelpers")
|
2019-06-06 22:42:18 +02:00
|
|
|
include(ECMOptionalAddSubdirectory)
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2020-11-08 14:28:12 +01:00
|
|
|
# Get submodule list if not already defined
|
2021-03-16 16:18:44 +01:00
|
|
|
if(NOT QT_BUILD_SUBMODULES)
|
|
|
|
if(DEFINED ENV{QT_BUILD_SUBMODULES})
|
|
|
|
set(QT_BUILD_SUBMODULES "$ENV{QT_BUILD_SUBMODULES}")
|
|
|
|
else()
|
|
|
|
qt_internal_find_modules(QT_BUILD_SUBMODULES)
|
|
|
|
endif()
|
2020-11-08 14:28:12 +01:00
|
|
|
endif()
|
2020-01-08 17:04:43 +01:00
|
|
|
|
2020-11-13 13:42:42 +01:00
|
|
|
set(qt_module_dependency_map_prefix "__qt_module_dependencies_")
|
2021-03-16 16:18:44 +01:00
|
|
|
qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES
|
2020-11-13 13:42:42 +01:00
|
|
|
"${qt_module_dependency_map_prefix}")
|
2019-06-06 22:42:18 +02:00
|
|
|
|
2021-03-16 16:18:44 +01:00
|
|
|
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
2020-11-13 13:42:42 +01:00
|
|
|
# Check for unmet dependencies
|
|
|
|
if(NOT DEFINED BUILD_${module} OR BUILD_${module})
|
2021-03-12 14:53:23 +01:00
|
|
|
message(NOTICE "Checking dependencies of '${module}'")
|
|
|
|
get_property(required_deps GLOBAL PROPERTY QT_REQUIRED_DEPS_FOR_${module})
|
2020-11-13 13:42:42 +01:00
|
|
|
foreach(dep IN LISTS "${qt_module_dependency_map_prefix}${module}")
|
|
|
|
if (dep STREQUAL "qtbase")
|
|
|
|
# Always available skip
|
|
|
|
continue()
|
|
|
|
endif()
|
2021-03-12 14:53:23 +01:00
|
|
|
|
|
|
|
set(required FALSE)
|
|
|
|
if(dep IN_LIST required_deps)
|
|
|
|
set(required TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(error_reason "")
|
2020-11-13 13:42:42 +01:00
|
|
|
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dep}/CMakeLists.txt")
|
2021-03-12 14:53:23 +01:00
|
|
|
set(error_reason "${dep}'s CMakeLists.txt couldn't be found")
|
|
|
|
elseif(DEFINED BUILD_${dep} AND NOT BUILD_${dep})
|
|
|
|
set(error_reason "building '${dep}' was explicitly disabled")
|
2020-11-13 13:42:42 +01:00
|
|
|
endif()
|
2021-03-12 14:53:23 +01:00
|
|
|
|
|
|
|
if(NOT error_reason STREQUAL "")
|
|
|
|
if(required)
|
|
|
|
message(FATAL_ERROR "Module '${module}' depends on '${dep}', "
|
|
|
|
"but ${error_reason}.\n"
|
|
|
|
"Note: Use '-skip ${module}' to exclude it from the build.")
|
|
|
|
else()
|
|
|
|
message(NOTICE "Skipping optional dependency '${dep}' of '${module}', "
|
|
|
|
"because ${error_reason}.")
|
|
|
|
endif()
|
2020-11-13 13:42:42 +01:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2020-11-16 12:35:31 +01:00
|
|
|
endforeach()
|
2020-11-13 13:42:42 +01:00
|
|
|
|
2021-03-16 16:18:44 +01:00
|
|
|
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
2020-11-16 12:35:31 +01:00
|
|
|
message(NOTICE "Configuring '${module}'")
|
2020-11-08 14:28:12 +01:00
|
|
|
ecm_optional_add_subdirectory("${module}")
|
2019-06-06 22:42:18 +02:00
|
|
|
|
2020-11-08 14:28:12 +01:00
|
|
|
if(module STREQUAL "qtbase")
|
|
|
|
if (NOT QT_BUILD_STANDALONE_TESTS)
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/lib/cmake")
|
|
|
|
list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-01-08 17:04:43 +01:00
|
|
|
endforeach()
|
|
|
|
|
2019-06-06 22:42:18 +02:00
|
|
|
if(NOT QT_BUILD_STANDALONE_TESTS)
|
|
|
|
# Display a summary of everything
|
|
|
|
include(QtBuildInformation)
|
2020-11-19 12:19:39 +01:00
|
|
|
include(QtPlatformSupport)
|
2019-06-06 22:42:18 +02:00
|
|
|
qt_print_feature_summary()
|
|
|
|
qt_print_build_instructions()
|
|
|
|
endif()
|