summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2607734..6a9265f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,9 +8,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Build external dependencies (open62541, qtopcua) if not already built
include(cmake/BuildDeps.cmake)
-# Local QtOpcUa must come before system Qt so find_package picks up our build
-# instead of any system-installed QtOpcUa.
-list(PREPEND CMAKE_PREFIX_PATH "${QTOPCUA_BUILD_DIR}")
+# Tell Qt's find_package to also look in our local QtOpcUa install for
+# components (Qt6Config.cmake only searches its own install dir by default).
+list(PREPEND QT_ADDITIONAL_PACKAGES_PREFIX_PATH "${QTOPCUA_INSTALL_DIR}")
list(PREPEND CMAKE_PREFIX_PATH "${OPEN62541_INSTALL_DIR}")
find_package(Qt6 6.10.2 REQUIRED COMPONENTS Core Qml Quick OpcUa)
@@ -27,7 +27,8 @@ set(QML_IMPORT_PATH
# Ensure the local QtOpcUa and open62541 libs are findable at runtime (needed
# because the Qt plugin loader dlopen's the open62541 backend).
-set(CMAKE_BUILD_RPATH "${QTOPCUA_BUILD_DIR}/lib" "${OPEN62541_INSTALL_DIR}/lib")
+set(CMAKE_BUILD_RPATH "${QTOPCUA_INSTALL_DIR}/lib"
+ "${OPEN62541_INSTALL_DIR}/lib")
add_subdirectory(src)
add_subdirectory(demo)