Skip to content

Commit 8de1ce1

Browse files
committed
adapted open62541 examples
1 parent 2394b24 commit 8de1ce1

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/open62541/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
FIND_PACKAGE(open62541 REQUIRED)
2+
13
ADD_EXECUTABLE(open62541_client client.cpp)
24
TARGET_LINK_LIBRARIES(open62541_client PRIVATE open62541::open62541)
35

src/open62541pp/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
INCLUDE(FetchContent)
2-
3-
FETCHCONTENT_DECLARE(
4-
open62541pp
5-
GIT_REPOSITORY https://github.com/open62541pp/open62541pp.git
6-
GIT_TAG v0.15.0
7-
)
8-
FETCHCONTENT_MAKEAVAILABLE(open62541pp)
1+
FIND_PACKAGE(open62541pp QUIET)
2+
IF(NOT open62541pp_FOUND)
3+
MESSAGE("open62541pp could not be located in the CMake module search path. Downloading it from Git and building it locally")
4+
INCLUDE(FetchContent)
5+
FETCHCONTENT_DECLARE(
6+
open62541pp
7+
GIT_REPOSITORY https://github.com/open62541pp/open62541pp.git
8+
GIT_TAG v0.13.0
9+
)
10+
FETCHCONTENT_MAKEAVAILABLE(open62541pp)
11+
ENDIF()
912

1013
ADD_EXECUTABLE(open62541pp_client client.cpp)
1114
TARGET_LINK_LIBRARIES(open62541pp_client PRIVATE open62541pp::open62541pp)
12-
TARGET_INCLUDE_DIRECTORIES(open62541pp_client PUBLIC ${open62541pp_SOURCE_DIR})
1315

1416
ADD_EXECUTABLE(open62541pp_server server.cpp)
1517
TARGET_LINK_LIBRARIES(open62541pp_server PRIVATE open62541pp::open62541pp)
16-
TARGET_INCLUDE_DIRECTORIES(open62541pp_server PUBLIC ${open62541pp_SOURCE_DIR})

0 commit comments

Comments
 (0)