-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
73 lines (61 loc) · 1.83 KB
/
CMakeLists.txt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 2024 (c) Aleksander Rozhkov <aleksprog@hotmail.com>
#
cmake_minimum_required(VERSION 3.18)
project(nodesetexporter-demo
VERSION 1.1.0
DESCRIPTION "An example of including and using nodesetexporter as a shared library."
LANGUAGES CXX)
# Installing the C++ Language Standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set compiler flags.
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Wall -Werror")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wall -Werror")
# Set default build type.
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE is not set. Set it to 'Release' by default.")
set(CMAKE_BUILD_TYPE "Release")
endif ()
add_subdirectory(3rdparty)
find_package(open62541 REQUIRED)
find_package(nodesetexporter REQUIRED)
add_library(${PROJECT_NAME}-static STATIC)
target_sources(
${PROJECT_NAME}-static
PUBLIC
include/apps/nodesetexporter-demo/Application.h
include/apps/nodesetexporter-demo/BrowseOperations.h
PRIVATE
src/apps/nodesetexporter-demo/Application.cpp
src/apps/nodesetexporter-demo/BrowseOperations.cpp
)
target_include_directories(
${PROJECT_NAME}-static
PUBLIC
include/
3rdparty/fmt-10.2.0/include/
)
target_link_libraries(
${PROJECT_NAME}-static
PUBLIC
nodesetexporter-demo
nodesetexporter
open62541::open62541
fmt::fmt
)
add_executable(${PROJECT_NAME})
target_sources(
${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
)
target_link_libraries(
${PROJECT_NAME}
PUBLIC
${PROJECT_NAME}-static
)