summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-19 05:13:42 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-19 05:38:24 +0100
commita0c7f2a7ef04dbe2e7491eabf828e26423d1bd10 (patch)
tree50491c80f28ad5f2789a3777bec74489327c4d7f /CMakeLists.txt
parent23916cbb98e952aab752a647ac96020aab709bb6 (diff)
downloadBobinkQtOpcUa-a0c7f2a7ef04dbe2e7491eabf828e26423d1bd10.tar.gz
BobinkQtOpcUa-a0c7f2a7ef04dbe2e7491eabf828e26423d1bd10.zip
Rename targets, route messages to debug console, clean up
- Rename CMake project and library target to BobinkQtOpcUa (URI stays Bobink) - Rename demo target to BobinkDemo, output binary to build/bin/ - Route all QML status/error messages to the in-app debug console - Remove discoveryInterval QML property, default to 30s internally - Add errorChanged handler, PKI file validation in applyPki()
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73ab94d..2607734 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
-project(Bobink LANGUAGES CXX)
+project(BobinkQtOpcUa LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -8,19 +8,26 @@ 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.
+# 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}")
list(PREPEND CMAKE_PREFIX_PATH "${OPEN62541_INSTALL_DIR}")
find_package(Qt6 6.10.2 REQUIRED COMPONENTS Core Qml Quick OpcUa)
qt_standard_project_setup(REQUIRES 6.10.2)
-# 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 path for qmllint
+set(QML_IMPORT_PATH
+ "${CMAKE_CURRENT_BINARY_DIR}/qml"
+ CACHE STRING "Path to locally built qml")
+# Generate .qmlls.ini for QML Language Server. Useful once QtOpcUa is installed
+# globally (qt-cmake --install build/deps/qtopcua-build) so qmlls can resolve
+# all Qt QML imports without extra importPaths. set(QT_QML_GENERATE_QMLLS_INI ON
+# CACHE BOOL "")
+
+# 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")
add_subdirectory(src)
add_subdirectory(demo)