2018-10-21 14:52:41 +08:00
|
|
|
link_libraries(drogon trantor pthread dl)
|
|
|
|
|
2018-06-28 23:29:40 +08:00
|
|
|
FILE(GLOB SCP_LIST ${CMAKE_CURRENT_SOURCE_DIR}/simple_example/*.csp)
|
2018-05-30 13:23:59 +08:00
|
|
|
foreach(cspFile ${SCP_LIST})
|
|
|
|
message(STATUS "cspFile:" ${cspFile})
|
2018-10-17 18:43:51 +08:00
|
|
|
EXEC_PROGRAM(basename ARGS "${cspFile} .csp" OUTPUT_VARIABLE classname)
|
2018-05-30 13:23:59 +08:00
|
|
|
message(STATUS "view classname:" ${classname})
|
|
|
|
add_custom_command(OUTPUT ${classname}.h ${classname}.cc
|
|
|
|
COMMAND drogon_ctl
|
|
|
|
ARGS create view ${cspFile}
|
|
|
|
DEPENDS ${cspFile}
|
|
|
|
VERBATIM )
|
|
|
|
set(VIEWSRC ${VIEWSRC} ${classname}.cc)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
2018-06-28 23:29:40 +08:00
|
|
|
AUX_SOURCE_DIRECTORY(simple_example DIR_STATIC)
|
2018-05-30 13:23:59 +08:00
|
|
|
|
|
|
|
add_executable(webapp ${DIR_STATIC} ${VIEWSRC})
|
2018-05-30 13:59:12 +08:00
|
|
|
add_dependencies(webapp drogon_ctl)
|
2018-05-30 13:23:59 +08:00
|
|
|
|
2018-07-24 17:24:23 +08:00
|
|
|
AUX_SOURCE_DIRECTORY(client_example DIR_CLIENT)
|
2018-12-15 20:05:19 +08:00
|
|
|
AUX_SOURCE_DIRECTORY(benchmark DIR_BENCHMARK)
|
2019-03-12 18:21:35 +08:00
|
|
|
#AUX_SOURCE_DIRECTORY(simple_example_test DIR_TEST)
|
2018-07-24 17:24:23 +08:00
|
|
|
|
|
|
|
add_executable(client ${DIR_CLIENT})
|
2018-12-15 20:05:19 +08:00
|
|
|
add_executable(benchmark ${DIR_BENCHMARK})
|
2019-03-12 18:21:35 +08:00
|
|
|
add_executable(webapp_test simple_example_test/main.cc)
|
|
|
|
add_executable(pipeline_test simple_example_test/HttpPipelineTest.cc)
|
2019-01-19 22:57:07 +08:00
|
|
|
|
|
|
|
add_custom_command(TARGET webapp POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2019-03-27 19:32:09 +08:00
|
|
|
${PROJECT_SOURCE_DIR}/config.example.json ${PROJECT_SOURCE_DIR}/drogon.jpg
|
|
|
|
${PROJECT_SOURCE_DIR}/trantor/trantor/tests/server.pem $<TARGET_FILE_DIR:webapp>)
|