|
@@ -71,22 +71,17 @@ else()
|
|
endif()
|
|
endif()
|
|
|
|
|
|
## extensions
|
|
## extensions
|
|
-option(EXTENSION_STATELESS "Enable stateless extension" OFF)
|
|
|
|
option(EXTENSION_UDP "Enable udp extension" OFF)
|
|
option(EXTENSION_UDP "Enable udp extension" OFF)
|
|
-
|
|
|
|
if(EXTENSION_UDP)
|
|
if(EXTENSION_UDP)
|
|
set(EXTENSION_STATELESS ON)
|
|
set(EXTENSION_STATELESS ON)
|
|
message(STATUS "Extensions: enabling udp")
|
|
message(STATUS "Extensions: enabling udp")
|
|
add_definitions(-DEXTENSION_UDP)
|
|
add_definitions(-DEXTENSION_UDP)
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
+option(EXTENSION_STATELESS "Enable stateless extension" OFF)
|
|
if(EXTENSION_STATELESS)
|
|
if(EXTENSION_STATELESS)
|
|
message(STATUS "Extensions: enabling stateless")
|
|
message(STATUS "Extensions: enabling stateless")
|
|
add_definitions(-DEXTENSION_STATELESS)
|
|
add_definitions(-DEXTENSION_STATELESS)
|
|
- add_executable(statelessClient $<TARGET_OBJECTS:open62541-objects> examples/statelessClient.c)
|
|
|
|
- if(MULTITHREADING)
|
|
|
|
- target_link_libraries(statelessClient urcu-cds urcu urcu-common pthread)
|
|
|
|
- endif()
|
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
add_library(open62541-objects OBJECT ${lib_sources})
|
|
add_library(open62541-objects OBJECT ${lib_sources})
|
|
@@ -143,35 +138,31 @@ if(CLIENT)
|
|
add_definitions( -DBENCHMARK=1 )
|
|
add_definitions( -DBENCHMARK=1 )
|
|
# the client is built directly with the .o files as it currently uses
|
|
# the client is built directly with the .o files as it currently uses
|
|
# internal functions that are not exported to the shared lib.
|
|
# internal functions that are not exported to the shared lib.
|
|
- add_executable(exampleClient $<TARGET_OBJECTS:open62541-objects> examples/opcuaClient.c)
|
|
|
|
|
|
+ add_executable(exampleClient $<TARGET_OBJECTS:open62541-objects> examples/client.c)
|
|
if(MULTITHREADING)
|
|
if(MULTITHREADING)
|
|
target_link_libraries(exampleClient urcu-cds urcu urcu-common pthread)
|
|
target_link_libraries(exampleClient urcu-cds urcu urcu-common pthread)
|
|
endif()
|
|
endif()
|
|
|
|
+ if(EXTENSION_STATELESS)
|
|
|
|
+ add_executable(statelessClient $<TARGET_OBJECTS:open62541-objects> examples/client_stateless.c)
|
|
|
|
+ if(MULTITHREADING)
|
|
|
|
+ target_link_libraries(statelessClient urcu-cds urcu urcu-common pthread)
|
|
|
|
+ endif()
|
|
|
|
+ endif()
|
|
endif()
|
|
endif()
|
|
|
|
|
|
# build example server
|
|
# build example server
|
|
option(EXAMPLESERVER "Build a test server" OFF)
|
|
option(EXAMPLESERVER "Build a test server" OFF)
|
|
if(EXAMPLESERVER)
|
|
if(EXAMPLESERVER)
|
|
-set(server_sources examples/networklayer_tcp.c examples/logger_stdout.c)
|
|
|
|
-if(EXTENSION_UDP)
|
|
|
|
- list(APPEND server_sources examples/networklayer_udp.c)
|
|
|
|
-endif()
|
|
|
|
-add_executable(exampleServer examples/opcuaServer.c ${server_sources} ${exported_headers} ${generated_headers})
|
|
|
|
-add_executable(exampleServerDataSource examples/opcuaServerDataSource.c ${server_sources}
|
|
|
|
- ${exported_headers} ${generated_headers})
|
|
|
|
-target_link_libraries(exampleServer open62541)
|
|
|
|
-target_link_libraries(exampleServerDataSource open62541)
|
|
|
|
-if(WIN32)
|
|
|
|
- target_link_libraries(exampleServer ws2_32)
|
|
|
|
- target_link_libraries(exampleServerDataSource ws2_32)
|
|
|
|
-else()
|
|
|
|
- target_link_libraries(exampleServer rt)
|
|
|
|
- target_link_libraries(exampleServerDataSource rt)
|
|
|
|
-endif(WIN32)
|
|
|
|
-if(MULTITHREADING)
|
|
|
|
- target_link_libraries(exampleServer urcu-cds urcu urcu-common pthread)
|
|
|
|
- target_link_libraries(exampleServerDataSource urcu-cds urcu urcu-common pthread)
|
|
|
|
-endif()
|
|
|
|
|
|
+ add_executable(exampleServer examples/server.c examples/networklayer_tcp.c examples/logger_stdout.c ${exported_headers} ${generated_headers})
|
|
|
|
+ target_link_libraries(exampleServer open62541)
|
|
|
|
+ if(WIN32)
|
|
|
|
+ target_link_libraries(exampleServer ws2_32)
|
|
|
|
+ else()
|
|
|
|
+ target_link_libraries(exampleServer rt)
|
|
|
|
+ endif()
|
|
|
|
+ if(MULTITHREADING)
|
|
|
|
+ target_link_libraries(exampleServer urcu-cds urcu urcu-common pthread)
|
|
|
|
+ endif()
|
|
endif()
|
|
endif()
|
|
|
|
|
|
## self-signed certificates
|
|
## self-signed certificates
|