aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-23 10:15:19 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-23 10:15:19 +0100
commita132c560437fe09714c43aa2a8c52a529a95e32b (patch)
tree18a2a72be19f86d5fbb16bebcbee2acd77232f0b /CMakeLists.txt
parent547f2830beb89c4c5152959fe9f852e5237f79ad (diff)
downloadBobinkQtOpcUa-a132c560437fe09714c43aa2a8c52a529a95e32b.tar.gz
BobinkQtOpcUa-a132c560437fe09714c43aa2a8c52a529a95e32b.zip
Add Windows support to build system and improve dep detection
Use platform-specific library names for skip detection (.so vs .lib). Find qt-cmake on Windows (qt-cmake.bat). Set CMAKE_BUILD_TYPE on dep builds. Use explicit Qt6*_DIR variables instead of fragile QT_ADDITIONAL_PACKAGES_PREFIX_PATH for finding locally-built QtOpcUa. On Windows: copy DLLs to bin/ (no RPATH), point to system OpenSSL. On Linux: keep existing symlink approach for open62541 libs.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a9265f..f35b498 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,9 +8,14 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Build external dependencies (open62541, qtopcua) if not already built
include(cmake/BuildDeps.cmake)
-# 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}")
+# Point CMake directly at the locally-built QtOpcUa packages.
+# Qt6Config.cmake uses NO_DEFAULT_PATH when searching for components, so
+# QT_ADDITIONAL_PACKAGES_PREFIX_PATH should work but is fragile in practice
+# (Qt Creator can interfere). Setting <Package>_DIR is always checked first.
+set(Qt6OpcUa_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUa")
+set(Qt6OpcUaPrivate_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUaPrivate")
+set(Qt6OpcUaTools_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUaTools")
+set(Qt6DeclarativeOpcua_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6DeclarativeOpcua")
list(PREPEND CMAKE_PREFIX_PATH "${OPEN62541_INSTALL_DIR}")
find_package(Qt6 6.10.2 REQUIRED COMPONENTS Core Qml Quick OpcUa)