aboutsummaryrefslogtreecommitdiffstats
path: root/tests/none_anon/server_lds.conf
blob: 7b15b20da58c2d09678177b408631b5cd10b489c (plain)
1
2
3
4
5
6
7
8
9
10
11
# ServerLDS — test: none_anon

port = 14840
applicationUri = urn:localhost:bobink:ServerLDS
certificate = certs/ServerLDS_cert.der
privateKey = certs/ServerLDS_key.der
cleanupTimeout = 60

authMode = anonymous

trustStore = certs/trust/server_lds
* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
cmake_minimum_required(VERSION 3.16)
project(BobinkQtOpcUaAppTemplate LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# ── Qt setup (must come before BobinkQtOpcUa so AUTOMOC is enabled) ───────
find_package(Qt6 6.10.2 REQUIRED COMPONENTS Quick)
qt_standard_project_setup(REQUIRES 6.10.2)

# ── QML tooling ────────────────────────────────────────────────────────────
# Generate .qmlls.ini for QML Language Server
set(QT_QML_GENERATE_QMLLS_INI
    ON
    CACHE BOOL "")

# ── BobinkQtOpcUa ──────────────────────────────────────────────────────────
# Builds open62541 and QtOpcUa from submodules automatically on first configure.
# Subsequent configures skip the dep builds (delete build/deps/*-install/ to
# force a rebuild).
#
# Prerequisites: Qt 6.10.2+ with qt-cmake in PATH, OpenSSL dev headers, Ninja,
# and initialized submodules: git submodule update --init --recursive
add_subdirectory(deps/BobinkQtOpcUa)

# ── QtXpl2 ──────────────────────────────────────────────────────────────── TCP
# client for the Alchemie XPL2 printhead remote protocol.
add_subdirectory(deps/QtXpl2)

# Ensure the qml/ import directory exists before qmlimportscanner runs
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/qml")

qt_add_executable(BobinkQtOpcUaAppTemplate main.cpp)
qt_add_qml_module(
  BobinkQtOpcUaAppTemplate
  URI
  BobinkQtOpcUaAppTemplate
  VERSION
  1.0
  QML_FILES
  Main.qml
  IMPORT_PATH
  "${CMAKE_BINARY_DIR}/deps/BobinkQtOpcUa/qml"
  "${CMAKE_BINARY_DIR}/deps/QtXpl2/qml")

# Executable goes to bin/ to avoid clashing with the QML module directory
set_target_properties(
  BobinkQtOpcUaAppTemplate PROPERTIES RUNTIME_OUTPUT_DIRECTORY
                                      "${CMAKE_BINARY_DIR}/bin")

# Link against BobinkQtOpcUaplugin (not BobinkQtOpcUa). The "plugin" target
# includes the QML type registration needed for `import Bobink`.
target_link_libraries(BobinkQtOpcUaAppTemplate
                      PRIVATE Qt6::Quick BobinkQtOpcUaplugin QtXpl2plugin)

# ── Runtime quirks ──────────────────────────────────────────────────────────
# BobinkQtOpcUa builds open62541 as a shared library. The QtOpcUa backend plugin
# (loaded at runtime via dlopen) needs to find it. These two lines make that
# work during development:

# RPATH: embed the dep lib dirs so the dynamic linker finds libopen62541 and
# libQt6OpcUa at runtime without installing them system-wide.
set(CMAKE_BUILD_RPATH "${QTOPCUA_INSTALL_DIR}/lib"
                      "${OPEN62541_INSTALL_DIR}/lib")

# Plugin path: Qt's plugin loader doesn't know about our locally-built QtOpcUa
# backend. Pass the path as a compile definition and call
# QCoreApplication::addLibraryPath(QTOPCUA_PLUGIN_PATH) in main.cpp *before*
# creating the QGuiApplication.
target_compile_definitions(
  BobinkQtOpcUaAppTemplate
  PRIVATE QTOPCUA_PLUGIN_PATH="${QTOPCUA_INSTALL_DIR}/plugins")