aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Le <cristian.le@qt.io>2025-02-25 11:21:43 +0100
committerCristian Le <cristian.le@qt.io>2025-03-05 16:46:23 +0100
commitc97cffb201fc95547dfdd5891d9b2e24f94649bc (patch)
tree72467b9f0b347785666905047f3c59833a6e4eb9
parentb79beba4247e86095e82d0f082eb540bc63f01cf (diff)
Switch `find_package` from `Qt6<module>` to `Qt6::<component>`
This guarantees that all find_package hints for `Qt6` are accounted for. Fixes: PYSIDE-3026 Change-Id: Iab7d3a72b1743747e360e7f5ed2372e1b30fa047 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
-rw-r--r--sources/pyside6/cmake/PySideHelpers.cmake8
-rw-r--r--sources/pyside6/cmake/PySideSetup.cmake13
2 files changed, 13 insertions, 8 deletions
diff --git a/sources/pyside6/cmake/PySideHelpers.cmake b/sources/pyside6/cmake/PySideHelpers.cmake
index ad94f278f..a4641ee65 100644
--- a/sources/pyside6/cmake/PySideHelpers.cmake
+++ b/sources/pyside6/cmake/PySideHelpers.cmake
@@ -173,13 +173,6 @@ macro(use_protected_as_public_hack)
endmacro()
macro(remove_skipped_modules)
- # Removing from the MODULES list the items that were defined with
- # -DSKIP_MODULES on command line
- if(SKIP_MODULES)
- foreach(s ${SKIP_MODULES})
- list(REMOVE_ITEM MODULES ${s})
- endforeach()
- endif()
foreach(m ${MODULES})
collect_module_if_found(${m})
@@ -221,7 +214,6 @@ macro(collect_module_if_found shortname)
set(quiet_argument "QUIET")
endif()
- find_package(${_qt_module_name} ${quiet_argument})
# If package is found, _name_found will be equal to 1
set(_name_found "${_qt_module_name}_FOUND")
# _name_dir will keep the path to the directory where the CMake rules were found
diff --git a/sources/pyside6/cmake/PySideSetup.cmake b/sources/pyside6/cmake/PySideSetup.cmake
index 34ec035b7..c92b0c986 100644
--- a/sources/pyside6/cmake/PySideSetup.cmake
+++ b/sources/pyside6/cmake/PySideSetup.cmake
@@ -170,7 +170,20 @@ collect_optional_modules()
# Modules to be built unless specified by -DMODULES on command line
if(NOT MODULES)
set(MODULES "${ALL_ESSENTIAL_MODULES};${ALL_OPTIONAL_MODULES}")
+ set(required_modules ${ALL_ESSENTIAL_MODULES})
+ set(optional_modules ${ALL_OPTIONAL_MODULES})
+else()
+ set(required_modules ${MODULES})
+ set(optional_modules)
endif()
+list(REMOVE_ITEM MODULES ${SKIP_MODULES})
+list(REMOVE_ITEM required_modules ${SKIP_MODULES})
+list(REMOVE_ITEM optional_modules ${SKIP_MODULES})
+
+find_package(Qt6
+ COMPONENTS ${required_modules}
+ OPTIONAL_COMPONENTS ${optional_modules}
+)
# This will contain the set of modules for which bindings are not built.
set(DISABLED_MODULES "${ALL_ESSENTIAL_MODULES};${ALL_OPTIONAL_MODULES}")