|
@@ -71,22 +71,17 @@ else()
|
|
|
endif()
|
|
|
|
|
|
## extensions
|
|
|
-option(EXTENSION_STATELESS "Enable stateless extension" OFF)
|
|
|
option(EXTENSION_UDP "Enable udp extension" OFF)
|
|
|
-
|
|
|
if(EXTENSION_UDP)
|
|
|
set(EXTENSION_STATELESS ON)
|
|
|
message(STATUS "Extensions: enabling udp")
|
|
|
add_definitions(-DEXTENSION_UDP)
|
|
|
endif()
|
|
|
|
|
|
+option(EXTENSION_STATELESS "Enable stateless extension" OFF)
|
|
|
if(EXTENSION_STATELESS)
|
|
|
message(STATUS "Extensions: enabling 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()
|
|
|
|
|
|
add_library(open62541-objects OBJECT ${lib_sources})
|
|
@@ -143,35 +138,31 @@ if(CLIENT)
|
|
|
add_definitions( -DBENCHMARK=1 )
|
|
|
# the client is built directly with the .o files as it currently uses
|
|
|
# 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)
|
|
|
target_link_libraries(exampleClient urcu-cds urcu urcu-common pthread)
|
|
|
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()
|
|
|
|
|
|
# build example server
|
|
|
option(EXAMPLESERVER "Build a test server" OFF)
|
|
|
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()
|
|
|
|
|
|
## self-signed certificates
|