CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. include_directories(${PROJECT_SOURCE_DIR}/include)
  2. include_directories(${PROJECT_SOURCE_DIR}/deps)
  3. include_directories(${PROJECT_SOURCE_DIR}/src)
  4. include_directories(${PROJECT_BINARY_DIR}/src_generated)
  5. find_package(Check REQUIRED)
  6. find_package(Threads REQUIRED)
  7. set(LIBS ${CHECK_LIBRARIES})
  8. if(NOT WIN32)
  9. list(APPEND LIBS rt pthread)
  10. endif(NOT WIN32)
  11. if(MULTITHREADING)
  12. list(APPEND LIBS urcu-cds urcu urcu-common)
  13. endif(MULTITHREADING)
  14. # the unit test are built directly on the open62541 object files. so they can
  15. # access symbols that are hidden/not exported to the shared library
  16. add_executable(check_builtin check_builtin.c ${PROJECT_SOURCE_DIR}/src/ua_types.c
  17. ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.c
  18. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c)
  19. target_link_libraries(check_builtin ${LIBS})
  20. add_test(builtin ${CMAKE_CURRENT_BINARY_DIR}/check_builtin)
  21. add_executable(check_memory check_memory.c ${PROJECT_SOURCE_DIR}/src/ua_types.c
  22. ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.c
  23. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c)
  24. target_link_libraries(check_memory ${LIBS})
  25. add_test(memory ${CMAKE_CURRENT_BINARY_DIR}/check_memory)
  26. # add_executable(check_stack check_stack.c)
  27. # target_link_libraries(check_stack ${LIBS})
  28. # add_test(stack ${CMAKE_CURRENT_BINARY_DIR}/check_stack)
  29. # add_executable(check_base64 check_base64.c)
  30. # target_link_libraries(check_base64 ${LIBS})
  31. # add_test(base64 ${CMAKE_CURRENT_BINARY_DIR}/check_base64)
  32. add_executable(check_services_view check_services_view.c)
  33. target_link_libraries(check_services_view ${LIBS})
  34. add_test(services_view ${CMAKE_CURRENT_BINARY_DIR}/check_services_view)
  35. add_executable(check_nodestore check_nodestore.c ${PROJECT_SOURCE_DIR}/src/ua_types.c
  36. ${PROJECT_SOURCE_DIR}/src/server/ua_nodes.c
  37. ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.c
  38. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c)
  39. target_link_libraries(check_nodestore ${LIBS})
  40. add_test(nodestore ${CMAKE_CURRENT_BINARY_DIR}/check_nodestore)
  41. # add_executable(check_startup check_startup.c)
  42. # target_link_libraries(check_startup ${LIBS})
  43. # add_test(startup ${CMAKE_CURRENT_BINARY_DIR}/check_startup)