aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-25 16:11:53 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-25 18:08:28 +0100
commit7bb49eabdf8d86567660c8825892eb323fa6e674 (patch)
treebbcfb9f80fa8373dc61e63cafef30e8a664cedea /CMakeLists.txt
parent9507f9779809bd077705d1ad54384f714b41c122 (diff)
downloadBobinkQtOpcUa-7bb49eabdf8d86567660c8825892eb323fa6e674.tar.gz
BobinkQtOpcUa-7bb49eabdf8d86567660c8825892eb323fa6e674.zip
Add .qmlformat.ini, qmlls support, and format QML files
- Enable QT_QML_GENERATE_QMLLS_INI for QML Language Server support - Add IMPORT_PATH to demo's qt_add_qml_module so .qmlls.ini includes the local build QML directory alongside the Qt system path - Add editor setup section to README with qmlls and qmlformat guidance - Add QML formatting section to French guide - Reformat demo QML files with .qmlformat.ini (line wrapping at 80 cols)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 10 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51b90e8..0be515b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,14 +10,15 @@ endif()
# Build external dependencies (open62541, qtopcua) if not already built
include(cmake/BuildDeps.cmake)
-# 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.
+# 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")
+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)
@@ -29,10 +30,10 @@ if(PROJECT_IS_TOP_LEVEL)
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 "")
+ # Generate .qmlls.ini for QML Language Server
+ 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).