CMakeLists.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. include_directories(${PROJECT_SOURCE_DIR}/include)
  2. include_directories(${PROJECT_BINARY_DIR}/src_generated)
  3. set(LIBS open62541-static)
  4. if(NOT WIN32)
  5. list(APPEND LIBS pthread)
  6. if (NOT APPLE)
  7. list(APPEND LIBS rt)
  8. endif()
  9. else()
  10. list(APPEND LIBS ws2_32)
  11. endif()
  12. if(UA_ENABLE_MULTITHREADING)
  13. list(APPEND LIBS urcu-cds urcu urcu-common)
  14. endif()
  15. # add_executable(server_readspeed server_readspeed.c)
  16. # target_link_libraries(server_readspeed ${LIBS})
  17. add_executable(server_variable server_variable.c)
  18. target_link_libraries(server_variable ${LIBS})
  19. add_executable(server_mainloop server_mainloop.c)
  20. target_link_libraries(server_mainloop ${LIBS})
  21. add_executable(server_datasource server_datasource.c)
  22. target_link_libraries(server_datasource ${LIBS})
  23. add_executable(server_firstSteps server_firstSteps.c)
  24. target_link_libraries(server_firstSteps ${LIBS})
  25. add_executable(client_firstSteps client_firstSteps.c)
  26. target_link_libraries(client_firstSteps ${LIBS})
  27. if(UA_ENABLE_DISCOVERY)
  28. add_executable(discovery_server_discovery discovery/server_discovery.c)
  29. target_link_libraries(discovery_server_discovery ${LIBS})
  30. # can currently only be build on linux, because windows is missing pthread support
  31. add_executable(discovery_server_register discovery/server_register.c)
  32. target_link_libraries(discovery_server_register ${LIBS})
  33. add_executable(discovery_client_find_servers discovery/client_find_servers.c)
  34. target_link_libraries(discovery_client_find_servers ${LIBS})
  35. endif()
  36. if(NOT UA_ENABLE_AMALGAMATION)
  37. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/nodeset.h ${PROJECT_BINARY_DIR}/src_generated/nodeset.c
  38. PRE_BUILD
  39. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
  40. -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
  41. ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
  42. ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml
  43. ${PROJECT_BINARY_DIR}/src_generated/nodeset
  44. DEPENDS ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
  45. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
  46. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
  47. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_builtin_types.py
  48. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_constants.py
  49. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
  50. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py
  51. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
  52. ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml)
  53. add_executable(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c)
  54. target_link_libraries(server_nodeset ${LIBS})
  55. endif()
  56. if(UA_ENABLE_METHODCALLS)
  57. add_executable(server_method server_method.c)
  58. target_link_libraries(server_method ${LIBS})
  59. endif()