summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 73ab94de5a7063e50a0870f8f251b5d6efaea6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cmake_minimum_required(VERSION 3.16)
project(Bobink LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
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}")
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")

add_subdirectory(src)
add_subdirectory(demo)