-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (73 loc) · 2.26 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.10)
project(open62541++)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -std=c++1z -pthread -Wno-unknown-pragmas")
set(Boost_USE_STATIC_LIBS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# BOOST libs
set(BOOST_LIBRARYDIR /home/me/Projects/boost/boost_1_69_0/libs)
set (BOOST_ROOT /home/me/Projects/boost/boost_1_69_0)
find_package(Boost 1.69.0 REQUIRED COMPONENTS unit_test_framework log REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
endif()
find_package(open62541 REQUIRED)
#include_directories(include third-party/open62541/build/include third-party/base64/include)
include_directories(include staging/include/open62541 third-party/ostr/include third-party/flog/include)
set(
SOURCES
src/applicationdescription.cpp
src/client.cpp
src/endpointdescription.cpp
src/expandednodeid.cpp
src/identifier.cpp
src/localizedtext.cpp
src/nodeid.cpp
src/qualifiedname.cpp
src/referencedescription.cpp
src/usertokenpolicy.cpp
src/guid.cpp
src/browserequest.cpp
src/browsedescription.cpp
src/browseresult.cpp
src/browseresponse.cpp
src/diagnosticinfo.cpp
src/requestheader.cpp
src/responseheader.cpp
src/viewdescription.cpp
src/datetime.cpp
src/extensionobject.cpp
)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(
${PROJECT_NAME}
PUBLIC ${Boost_LIBRARIES}
open62541
)
enable_testing()
function (make_test TEST_NAME)
add_executable(${TEST_NAME} test/${TEST_NAME}.cpp)
target_link_libraries(
${TEST_NAME}
${PROJECT_NAME}
${Boost_LIBRARIES}
)
target_compile_definitions(
${TEST_NAME}
PRIVATE BOOST_TEST_DYN_LINK
)
add_test(${TEST_NAME} ${TEST_NAME})
endfunction()
include_directories(test/include)
make_test(applicationdescription_test)
make_test(endpointdescription_test)
make_test(browsedescription_test)
make_test(browserequest_test)
make_test(browseresponse_test)
make_test(datetime_test)
make_test(diagnosticinfo_test)
make_test(expandednodeid_test)
# make_test(extensionobject_test)