Skip to content
Snippets Groups Projects

Ensure all known Qt packages are looked up

Merged Alexandru Croitor requested to merge better-module-linking-v2 into better-module-linking
1 file
+ 20
1
Compare changes
  • Side-by-side
  • Inline
+ 20
1
@@ -6,6 +6,25 @@ find_package(
@@ -6,6 +6,25 @@ find_package(
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network WebSockets)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network WebSockets)
 
# In shared Qt builds, the qml plugins don't have dependencies on their backing libraries, and
 
# thus the backing library packages are not automatically looked up.
 
# The StandaloneTests directory contains Config files that find_package all installed Qt packages.
 
# Abuse that, and include all of them to make all the backing libraries available as imported
 
# targets.
 
find_package(Qt6 COMPONENTS BuildInternals)
 
if(Qt6BuildInternals_DIR)
 
set(standalone_tests_dir "${Qt6BuildInternals_DIR}/StandaloneTests")
 
if(EXISTS "${standalone_tests_dir}")
 
# Glob the config files in there.
 
file(GLOB_RECURSE standalone_tests_files "${standalone_tests_dir}/*TestsConfig.cmake")
 
 
# Include each one of them.
 
foreach(standalone_tests_file IN LISTS standalone_tests_files)
 
include("${standalone_tests_file}")
 
endforeach()
 
endif()
 
endif()
 
set(imports "")
set(imports "")
# Get all imported targets.
# Get all imported targets.
@@ -80,7 +99,6 @@ ${dummy_valid_content}
@@ -80,7 +99,6 @@ ${dummy_valid_content}
qt_add_executable(${PROJECT_NAME}
qt_add_executable(${PROJECT_NAME}
# backend/importdummy.qml
# backend/importdummy.qml
"${imports_file_path}"
backend/main.cpp
backend/main.cpp
backend/logger.h
backend/logger.h
backend/backend.cpp backend/backend.h
backend/backend.cpp backend/backend.h
@@ -100,6 +118,7 @@ qt_add_qml_module(${PROJECT_NAME}
@@ -100,6 +118,7 @@ qt_add_qml_module(${PROJECT_NAME}
URI AndroidUI
URI AndroidUI
VERSION 1.0
VERSION 1.0
QML_FILES
QML_FILES
 
"${imports_file_path}"
Constants.qml
Constants.qml
HomePage.qml
HomePage.qml
Main.qml
Main.qml
Loading