CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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(ENABLE_MULTITHREADING)
  13. list(APPEND LIBS urcu-cds urcu urcu-common)
  14. endif(ENABLE_MULTITHREADING)
  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_datasource server_datasource.c)
  20. target_link_libraries(server_datasource ${LIBS})
  21. add_executable(server_firstSteps server_firstSteps.c)
  22. target_link_libraries(server_firstSteps ${LIBS})
  23. add_executable(client_firstSteps client_firstSteps.c)
  24. target_link_libraries(client_firstSteps ${LIBS})
  25. if(NOT ENABLE_AMALGAMATION)
  26. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/nodeset.h ${PROJECT_BINARY_DIR}/src_generated/nodeset.c
  27. PRE_BUILD
  28. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml ${PROJECT_BINARY_DIR}/src_generated/nodeset
  29. DEPENDS ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
  30. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
  31. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
  32. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_builtin_types.py
  33. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_constants.py
  34. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
  35. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py
  36. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
  37. ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml)
  38. add_executable(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c)
  39. target_link_libraries(server_nodeset ${LIBS})
  40. endif()
  41. if(ENABLE_METHODCALLS)
  42. add_executable(server_method server_method.c)
  43. target_link_libraries(server_method ${LIBS})
  44. endif()