CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. add_subdirectory(UtilDemo)
  2. add_subdirectory(CoroutineDemo)
  3. add_subdirectory(HttpDemo)
  4. add_subdirectory(CustomDemo)
  5. add_subdirectory(PushDemo)
  6. add_subdirectory(QuickStartDemo)
  7. add_subdirectory(StressDemo)
  8. if(WIN32)
  9. add_custom_target(run-quick-start
  10. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  11. DEPENDS QuickStartDemo QuickStartDemoClient
  12. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-quick-start.bat
  13. COMMENT "call quick start: ${CMAKE_BINARY_DIR}")
  14. add_custom_target(run-http
  15. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  16. DEPENDS HttpServer HttpClient
  17. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http.bat
  18. COMMENT "call run http")
  19. if(TARS_HTTP2)
  20. add_custom_target(run-http2
  21. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  22. DEPENDS Http2Server Http2Client
  23. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http2.bat
  24. COMMENT "call run http2")
  25. endif()
  26. add_custom_target(run-co
  27. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  28. DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
  29. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-co.bat
  30. COMMENT "call run co")
  31. add_custom_target(run-custom
  32. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  33. DEPENDS CustomServer CustomClient
  34. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-custom.bat
  35. COMMENT "call run custom")
  36. add_custom_target(run-push
  37. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  38. DEPENDS PushServer PushClient
  39. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-push.bat
  40. COMMENT "call run push")
  41. add_custom_target(run-all
  42. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  43. DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
  44. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-quick-start.bat
  45. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http.bat
  46. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-co.bat
  47. COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-push.bat
  48. COMMENT "call run all ${CMAKE_BINARY_DIR}")
  49. else(WIN32)
  50. add_custom_target(run-quick-start
  51. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  52. DEPENDS QuickStartDemo QuickStartDemoClient
  53. COMMAND sh ../examples/scripts/run-quick-start.sh
  54. COMMENT "call quick start")
  55. add_custom_target(run-http
  56. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  57. DEPENDS HttpServer HttpClient
  58. COMMAND sh ../examples/scripts/run-http.sh
  59. COMMENT "call run http")
  60. if(TARS_HTTP2)
  61. add_custom_target(run-http2
  62. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  63. DEPENDS Http2Server Http2Client
  64. COMMAND sh ../examples/scripts/run-http2.sh
  65. COMMENT "call run http2")
  66. endif()
  67. add_custom_target(run-co
  68. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  69. DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
  70. COMMAND sh ../examples/scripts/run-co.sh
  71. COMMENT "call run co")
  72. add_custom_target(run-custom
  73. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  74. DEPENDS CustomServer CustomClient
  75. COMMAND sh ../examples/scripts/run-custom.sh
  76. COMMENT "call run custom")
  77. add_custom_target(run-push
  78. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  79. DEPENDS PushServer PushClient
  80. COMMAND sh ../examples/scripts/run-push.sh
  81. COMMENT "call run push")
  82. add_custom_target(run-all
  83. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  84. DEPENDS run-quick-start run-http run-co run-push
  85. COMMAND sh ../examples/scripts/run-quick-start.sh
  86. COMMAND sh ../examples/scripts/run-http.sh
  87. COMMAND sh ../examples/scripts/run-co.sh
  88. COMMAND sh ../examples/scripts/run-push.sh
  89. COMMENT "call run all")
  90. endif(WIN32)