|
@@ -1,74 +1,47 @@
|
|
|
-include_directories(${PROJECT_SOURCE_DIR}/include)
|
|
|
-include_directories(${PROJECT_SOURCE_DIR}/plugins)
|
|
|
-include_directories(${PROJECT_BINARY_DIR})
|
|
|
-
|
|
|
-if(UA_ENABLE_AMALGAMATION)
|
|
|
- include_directories(${PROJECT_BINARY_DIR}) # contains open62541.h
|
|
|
-else()
|
|
|
- add_definitions(-DUA_NO_AMALGAMATION)
|
|
|
-endif()
|
|
|
-
|
|
|
-list(APPEND LIBS open62541 ${open62541_LIBRARIES})
|
|
|
-if(NOT WIN32)
|
|
|
- list(APPEND LIBS pthread)
|
|
|
- if (NOT APPLE)
|
|
|
- list(APPEND LIBS rt)
|
|
|
- endif()
|
|
|
-else()
|
|
|
- list(APPEND LIBS ws2_32)
|
|
|
-endif()
|
|
|
-if(UA_ENABLE_MULTITHREADING)
|
|
|
- list(APPEND LIBS urcu-cds urcu urcu-common)
|
|
|
-endif(UA_ENABLE_MULTITHREADING)
|
|
|
+include_directories(${PROJECT_BINARY_DIR}
|
|
|
+ ${PROJECT_BINARY_DIR}/src_generated
|
|
|
+ ${PROJECT_SOURCE_DIR}/plugins)
|
|
|
|
|
|
#############
|
|
|
# Tutorials #
|
|
|
#############
|
|
|
|
|
|
add_executable(tutorial_datatypes tutorial_datatypes.c)
|
|
|
-add_dependencies(tutorial_datatypes open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_datatypes ${LIBS})
|
|
|
+target_link_libraries(tutorial_datatypes open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(tutorial_server_firststeps tutorial_server_firststeps.c)
|
|
|
-add_dependencies(tutorial_server_firststeps open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_server_firststeps ${LIBS})
|
|
|
+target_link_libraries(tutorial_server_firststeps open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(tutorial_server_variable tutorial_server_variable.c)
|
|
|
-add_dependencies(tutorial_server_variable open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_server_variable ${LIBS})
|
|
|
+target_link_libraries(tutorial_server_variable open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(tutorial_server_datasource tutorial_server_datasource.c)
|
|
|
-add_dependencies(tutorial_server_datasource open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_server_datasource ${LIBS})
|
|
|
+target_link_libraries(tutorial_server_datasource open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(tutorial_server_variabletype tutorial_server_variabletype.c)
|
|
|
-add_dependencies(tutorial_server_variabletype open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_server_variabletype ${LIBS})
|
|
|
+target_link_libraries(tutorial_server_variabletype open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(tutorial_server_object tutorial_server_object.c)
|
|
|
-add_dependencies(tutorial_server_object open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_server_object ${LIBS})
|
|
|
+target_link_libraries(tutorial_server_object open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
if(UA_ENABLE_METHODCALLS)
|
|
|
add_executable(tutorial_server_method tutorial_server_method.c)
|
|
|
- add_dependencies(tutorial_server_method open625451_amalgamation)
|
|
|
- target_link_libraries(tutorial_server_method ${LIBS})
|
|
|
+ target_link_libraries(tutorial_server_method open62541 ${open62541_LIBRARIES})
|
|
|
endif()
|
|
|
|
|
|
add_executable(tutorial_client_firststeps tutorial_client_firststeps.c)
|
|
|
-add_dependencies(tutorial_client_firststeps open625451_amalgamation)
|
|
|
-target_link_libraries(tutorial_client_firststeps ${LIBS})
|
|
|
+target_link_libraries(tutorial_client_firststeps open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
##################
|
|
|
# Example Server #
|
|
|
##################
|
|
|
|
|
|
add_executable(server server.c)
|
|
|
-target_link_libraries(server ${LIBS})
|
|
|
+target_link_libraries(server open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
if(UA_ENABLE_NONSTANDARD_UDP)
|
|
|
add_executable(server_udp server_udp.c ${PROJECT_SOURCE_DIR}/plugins/ua_network_udp.c)
|
|
|
- target_link_libraries(server_udp ${LIBS})
|
|
|
+ target_link_libraries(server_udp open62541 ${open62541_LIBRARIES})
|
|
|
endif()
|
|
|
|
|
|
##################
|
|
@@ -76,28 +49,28 @@ endif()
|
|
|
##################
|
|
|
|
|
|
add_executable(client client.c)
|
|
|
-target_link_libraries(client ${LIBS})
|
|
|
+target_link_libraries(client open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
####################
|
|
|
# Feature Examples #
|
|
|
####################
|
|
|
|
|
|
add_executable(server_mainloop server_mainloop.c)
|
|
|
-target_link_libraries(server_mainloop ${LIBS})
|
|
|
+target_link_libraries(server_mainloop open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(server_instantiation server_instantiation.c)
|
|
|
-target_link_libraries(server_instantiation ${LIBS})
|
|
|
+target_link_libraries(server_instantiation open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(server_repeated_job server_repeated_job.c)
|
|
|
-target_link_libraries(server_repeated_job ${LIBS})
|
|
|
+target_link_libraries(server_repeated_job open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
add_executable(server_inheritance server_inheritance.c)
|
|
|
-target_link_libraries(server_inheritance ${LIBS})
|
|
|
+target_link_libraries(server_inheritance open62541 ${open62541_LIBRARIES})
|
|
|
|
|
|
-if(NOT BUILD_SHARED_LIBS AND UA_BUILD_EXAMPLES_NODESET_COMPILER)
|
|
|
+if(NOT BUILD_SHARED_open62541_LIBRARIES AND UA_BUILD_EXAMPLES_NODESET_COMPILER)
|
|
|
# needs internal methods which are not exported in the dynamic lib
|
|
|
add_executable(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c)
|
|
|
- target_link_libraries(server_nodeset ${LIBS})
|
|
|
+ target_link_libraries(server_nodeset open62541 ${open62541_LIBRARIES})
|
|
|
target_include_directories(server_nodeset PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/deps) # needs an internal header
|
|
|
endif()
|
|
|
|
|
@@ -111,12 +84,5 @@ if(UA_BUILD_SELFSIGNED_CERTIFICATE)
|
|
|
add_custom_target(selfsigned ALL DEPENDS server_cert.der ca.crt)
|
|
|
|
|
|
add_executable(server_certificate server_certificate.c server_cert.der ca.crt)
|
|
|
- target_link_libraries(server_certificate ${LIBS})
|
|
|
-endif()
|
|
|
-
|
|
|
-if(NOT BUILD_SHARED_LIBS)
|
|
|
- # needs internal methods which are not exported in the dynamic lib
|
|
|
- add_executable(server_readspeed server_readspeed.c)
|
|
|
- target_include_directories(server_readspeed PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/deps) # needs an internal header
|
|
|
- target_link_libraries(server_readspeed ${LIBS})
|
|
|
+ target_link_libraries(server_certificate open62541 ${open62541_LIBRARIES})
|
|
|
endif()
|