2021-09-22 13:11:47 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
|
|
|
project(FeaturesTest
|
|
|
|
VERSION 1.0.0
|
|
|
|
DESCRIPTION "QtFeature test"
|
|
|
|
HOMEPAGE_URL "https://qt.io/"
|
|
|
|
LANGUAGES CXX C
|
|
|
|
)
|
|
|
|
|
|
|
|
## Add some paths to check for cmake modules:
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin")
|
|
|
|
|
|
|
|
## Qt specific setup common for all modules:
|
|
|
|
include(QtSetup)
|
|
|
|
|
|
|
|
## Library to hold global features:
|
2019-01-10 09:50:38 +00:00
|
|
|
add_library(GlobalConfig INTERFACE)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2019-01-10 09:50:38 +00:00
|
|
|
qt_feature_module_begin(LIBRARY GlobalConfig
|
2018-10-24 13:20:27 +00:00
|
|
|
PUBLIC_FILE src/corelib/global/qconfig.h
|
|
|
|
PRIVATE_FILE src/corelib/global/qconfig_p.h
|
|
|
|
)
|
|
|
|
include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake")
|
2019-01-10 09:50:38 +00:00
|
|
|
qt_feature_module_end(GlobalConfig)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
|
|
|
assert(QT_FEATURE_top_a STREQUAL "ON")
|
|
|
|
assert(QT_FEATURE_top_b STREQUAL "OFF")
|
|
|
|
assert(QT_FEATURE_top_enabled STREQUAL "ON")
|
|
|
|
assert(QT_FEATURE_top_disabled STREQUAL "OFF")
|
|
|
|
assert(QT_FEATURE_top_disabled_enabled STREQUAL "OFF")
|
2018-11-14 13:24:34 +00:00
|
|
|
assert(QT_FEATURE_top_not_emitted STREQUAL "OFF")
|
2018-10-24 13:20:27 +00:00
|
|
|
|
|
|
|
## Enable feature summary at the end of the configure run:
|
|
|
|
include(FeatureSummary)
|
|
|
|
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
## Delayed actions on some of the Qt targets:
|
|
|
|
include(QtPostProcess)
|
|
|
|
|
|
|
|
## Print a feature summary:
|
|
|
|
feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|