CMakeLists.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. add_library(rotor_test_lib
  2. actor_test.cpp
  3. supervisor_test.cpp
  4. test-main.cpp
  5. )
  6. target_link_libraries(rotor_test_lib rotor::core)
  7. add_library(rotor::test ALIAS rotor_test_lib)
  8. set(rotor_TEST_LIBS rotor::core rotor::test)
  9. add_executable(010-sup-start_stop 010-sup-start_stop.cpp)
  10. target_link_libraries(010-sup-start_stop ${rotor_TEST_LIBS})
  11. add_test(010-sup-start_stop "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/010-sup-start_stop")
  12. add_executable(011-ping_pong 011-ping_pong.cpp)
  13. target_link_libraries(011-ping_pong ${rotor_TEST_LIBS})
  14. add_test(011-ping_pong "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/011-ping_pong")
  15. add_executable(012-actor-lifetime 012-actor-lifetime.cpp)
  16. target_link_libraries(012-actor-lifetime ${rotor_TEST_LIBS})
  17. add_test(012-actor-lifetime "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/012-actor-lifetime")
  18. add_executable(013-observer 013-observer.cpp)
  19. target_link_libraries(013-observer ${rotor_TEST_LIBS})
  20. add_test(013-observer "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/013-observer")
  21. add_executable(014-lifetime-observer 014-lifetime-observer.cpp)
  22. target_link_libraries(014-lifetime-observer ${rotor_TEST_LIBS})
  23. add_test(014-lifetime-observer "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/014-lifetime-observer")
  24. add_executable(015-actor-statuses 015-actor-statuses.cpp)
  25. target_link_libraries(015-actor-statuses ${rotor_TEST_LIBS})
  26. add_test(015-actor-statuses "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/015-actor-statuses")
  27. add_executable(016-pub_sub 016-pub_sub.cpp)
  28. target_link_libraries(016-pub_sub ${rotor_TEST_LIBS})
  29. add_test(016-pub_sub "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/016-pub_sub")
  30. add_executable(017-req-res 017-req-res.cpp)
  31. target_link_libraries(017-req-res ${rotor_TEST_LIBS})
  32. add_test(017-req-res "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/017-req-res")
  33. add_executable(018-lambda-handlers 018-lambda-handlers.cpp)
  34. target_link_libraries(018-lambda-handlers ${rotor_TEST_LIBS})
  35. add_test(018-lambda-handlers "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/018-lambda-handlers")
  36. add_executable(020-two-supervisors 020-two-supervisors.cpp)
  37. target_link_libraries(020-two-supervisors ${rotor_TEST_LIBS})
  38. add_test(020-two-supervisors "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/020-two-supervisors")
  39. add_executable(021-ping_pong-external 021-ping_pong-external.cpp)
  40. target_link_libraries(021-ping_pong-external ${rotor_TEST_LIBS})
  41. add_test(021-ping_pong-external "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/021-ping_pong-external")
  42. add_executable(022-supervisor-tree 022-supervisor-tree.cpp)
  43. target_link_libraries(022-supervisor-tree ${rotor_TEST_LIBS})
  44. add_test(022-supervisor-tree "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/022-supervisor-tree")
  45. add_executable(023-supervisor-children 023-supervisor-children.cpp)
  46. target_link_libraries(023-supervisor-children ${rotor_TEST_LIBS})
  47. add_test(023-supervisor-children "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/023-supervisor-children")
  48. add_executable(030-registry 030-registry.cpp)
  49. target_link_libraries(030-registry ${rotor_TEST_LIBS})
  50. add_test(030-registry "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/030-registry")
  51. if (BUILD_BOOST_ASIO)
  52. set(rotor_BOOTS_TEST_LIBS rotor::test rotor::asio)
  53. add_executable(101-asio_ping-pong-1-strand 101-asio_ping-pong-1-strand.cpp)
  54. target_link_libraries(101-asio_ping-pong-1-strand ${rotor_BOOTS_TEST_LIBS})
  55. add_test(101-asio_ping-pong-1-strand "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/101-asio_ping-pong-1-strand")
  56. add_executable(102-asio_ping-pong-2-strands 102-asio_ping-pong-2-strands.cpp)
  57. target_link_libraries(102-asio_ping-pong-2-strands ${rotor_BOOTS_TEST_LIBS})
  58. add_test(102-asio_ping-pong-2-strands "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/102-asio_ping-pong-2-strands")
  59. add_executable(103-asio_ping-pong-2-threads 103-asio_ping-pong-2-threads.cpp)
  60. target_link_libraries(103-asio_ping-pong-2-threads ${rotor_BOOTS_TEST_LIBS})
  61. add_test(103-asio_ping-pong-2-threads "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/103-asio_ping-pong-2-threads")
  62. add_executable(104-asio_timer 104-asio_timer.cpp)
  63. target_link_libraries(104-asio_timer ${rotor_BOOTS_TEST_LIBS})
  64. add_test(104-asio_timer "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/104-asio_timer")
  65. endif()
  66. if (BUILD_WX)
  67. find_package(wxWidgets COMPONENTS base core REQUIRED)
  68. include(${wxWidgets_USE_FILE})
  69. add_executable(121-wx_ping_ping 121-wx_ping_ping.cpp)
  70. target_link_libraries(121-wx_ping_ping rotor::test rotor::wx ${wxWidgets_LIBRARIES})
  71. add_test(121-wx_ping_ping "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/121-wx_ping_ping")
  72. add_executable(122-wx_timer 122-wx_timer.cpp)
  73. target_link_libraries(122-wx_timer rotor::test rotor::wx ${wxWidgets_LIBRARIES})
  74. add_test(122-wx_timer "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/122-wx_timer")
  75. endif()
  76. if (BUILD_EV)
  77. add_executable(131-ev_ping-pong 131-ev_ping-pong.cpp)
  78. target_link_libraries(131-ev_ping-pong rotor::test rotor::ev)
  79. add_test(131-ev_ping-pong "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/131-ev_ping-pong")
  80. add_executable(132-ev_timer 132-ev_timer.cpp)
  81. target_link_libraries(132-ev_timer rotor::test rotor::ev)
  82. add_test(132-ev_timer "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/132-ev_timer")
  83. endif()