-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Add detection of FEATURE_foo change by user
Unset all QT_FEATURE_foo values for every build. If any of FEATURE_foo is different of QT_FEATURE_foo, mark whole Qt build as dirty. Reset FEATURE_foo for dirty builds to the calculated value if it doesn't meet its condition. Set Qt module as NOT FOUND if its target was not created during configuration. Main issue with this approach are generated files, that became trash once the related features are disabled. This especially affects features that enable/disable Qt modules. FooConfig.cmake files are created and generate lots of warnings if feature was disabled. We may introduce a module cleanup procedure at some point. Fixes: QTBUG-85962 Pick-to: 6.0 Change-Id: Id71c1edb4027b24c6793063e40cc9d612c24ebce Reviewed-by: Joerg Bornemann <[email protected]>
- Loading branch information
Showing
3 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,32 +86,36 @@ if (NOT QT_NO_CREATE_TARGETS) | |
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS) | ||
endif() | ||
|
||
foreach(extra_cmake_include @extra_cmake_includes@) | ||
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") | ||
endforeach() | ||
if (TARGET @QT_CMAKE_EXPORT_NAMESPACE@::@target@) | ||
foreach(extra_cmake_include @extra_cmake_includes@) | ||
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") | ||
endforeach() | ||
|
||
include(${_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir}/QtFeature.cmake) | ||
include(${_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir}/QtFeature.cmake) | ||
|
||
qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@) | ||
qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@) | ||
|
||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
endif() | ||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
endif() | ||
|
||
list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@") | ||
list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@") | ||
|
||
get_target_property(_qt_module_target_type "@INSTALL_CMAKE_NAMESPACE@::@target@" TYPE) | ||
if(NOT _qt_module_target_type STREQUAL "INTERFACE_LIBRARY") | ||
get_target_property(_qt_module_plugin_types | ||
@INSTALL_CMAKE_NAMESPACE@::@target@ MODULE_PLUGIN_TYPES) | ||
if(_qt_module_plugin_types) | ||
list(APPEND QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE "${_qt_module_plugin_types}") | ||
get_target_property(_qt_module_target_type "@INSTALL_CMAKE_NAMESPACE@::@target@" TYPE) | ||
if(NOT _qt_module_target_type STREQUAL "INTERFACE_LIBRARY") | ||
get_target_property(_qt_module_plugin_types | ||
@INSTALL_CMAKE_NAMESPACE@::@target@ MODULE_PLUGIN_TYPES) | ||
if(_qt_module_plugin_types) | ||
list(APPEND QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE "${_qt_module_plugin_types}") | ||
endif() | ||
endif() | ||
endif() | ||
|
||
|
||
# Load Module's BuildInternals should any exist | ||
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND | ||
# Load Module's BuildInternals should any exist | ||
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND | ||
EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]") | ||
endif() | ||
else() | ||
set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" FALSE) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters