aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/CMakeLists.txt
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-01-12 14:49:58 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-01-15 15:44:42 +0000
commit8d0ce19ca6cef467e67a49cb720fa5ed61aaca35 (patch)
treef198de98bdd92cbb661d9afa0137995f6e2e36af /sources/pyside2/CMakeLists.txt
parent1eb4ea0a6122d8e05d72b26e988f806da04261f7 (diff)
Fix cmake scope for locally installed modules
If modules are installed on the system but not in the local Qt installation, cmake will find them and try to build, but this will lead to errors. Comparing the QT_INCLUDE_DIR and the path where the package was found, we can filter the modules that were found on a different directory. Change-Id: I463172b7081c191fb303387f98a495dd675e0486 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/CMakeLists.txt')
-rw-r--r--sources/pyside2/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt
index 6a8c612f3..bfd8eb5be 100644
--- a/sources/pyside2/CMakeLists.txt
+++ b/sources/pyside2/CMakeLists.txt
@@ -227,6 +227,9 @@ macro(COLLECT_MODULE_IF_FOUND shortname)
set(name "Qt5${shortname}")
find_package(${name})
set(_name_found "${name}_FOUND")
+ set(_name_dir "${name}_DIR")
+ get_filename_component(_qt_dir ${QT_INCLUDE_DIR} DIRECTORY)
+ get_filename_component(_module_dir "${${_name_dir}}/../../../" ABSOLUTE)
# Determine essential/optional/missing
set(module_state "missing")
@@ -240,7 +243,7 @@ macro(COLLECT_MODULE_IF_FOUND shortname)
set(module_state "essential")
endif()
- if(${_name_found})
+ if(${${_name_found}} AND ${_qt_dir} STREQUAL ${_module_dir})
message(STATUS "${module_state} module ${name} found (${ARGN})")
# record the shortnames for the tests
list(APPEND all_module_shortnames ${shortname})