2019-09-26 19:33:58 +08:00
|
|
|
link_libraries(${PROJECT_NAME})
|
2019-08-08 15:17:09 +08:00
|
|
|
|
2019-08-31 08:27:57 +08:00
|
|
|
set(benchmark_sources benchmark/BenchmarkCtrl.cc benchmark/JsonCtrl.cc
|
|
|
|
benchmark/main.cc)
|
2018-07-24 17:24:23 +08:00
|
|
|
|
2021-05-27 20:09:57 +08:00
|
|
|
add_executable(client client_example/main.cc)
|
|
|
|
add_executable(websocket_client websocket_client/WebSocketClient.cc)
|
2019-08-08 15:17:09 +08:00
|
|
|
add_executable(benchmark ${benchmark_sources})
|
2021-06-01 16:08:51 +08:00
|
|
|
add_executable(helloworld helloworld/main.cc
|
|
|
|
helloworld/HelloController.cc
|
|
|
|
helloworld/HelloViewController.cc)
|
|
|
|
drogon_create_views(helloworld
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/helloworld
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
add_executable(file_upload file_upload/file_upload.cc)
|
|
|
|
drogon_create_views(file_upload
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/file_upload
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
add_executable(login_session login_session/main.cc)
|
|
|
|
drogon_create_views(login_session
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/login_session
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2019-01-19 22:57:07 +08:00
|
|
|
|
2021-06-19 22:55:44 +08:00
|
|
|
add_executable(jsonstore jsonstore/main.cc)
|
|
|
|
|
2019-08-31 08:27:57 +08:00
|
|
|
set(example_targets
|
|
|
|
benchmark
|
2021-05-27 20:09:57 +08:00
|
|
|
client
|
2021-06-01 16:08:51 +08:00
|
|
|
websocket_client
|
|
|
|
helloworld
|
|
|
|
file_upload
|
2021-06-19 22:55:44 +08:00
|
|
|
login_session
|
|
|
|
jsonstore)
|
2019-07-26 22:22:12 +08:00
|
|
|
|
2021-06-27 09:54:02 +08:00
|
|
|
# Add warnings for our example targets--some warnings (such as -Wunused-parameter) only appear
|
|
|
|
# when the templated functions are instantiated at their point of use.
|
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
|
|
|
foreach(target ${example_targets})
|
|
|
|
target_compile_options(${target} PRIVATE -Wall -Wextra -Werror)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2019-08-31 08:27:57 +08:00
|
|
|
set_property(TARGET ${example_targets}
|
|
|
|
PROPERTY CXX_STANDARD ${DROGON_CXX_STANDARD})
|
2019-08-08 15:17:09 +08:00
|
|
|
set_property(TARGET ${example_targets} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
set_property(TARGET ${example_targets} PROPERTY CXX_EXTENSIONS OFF)
|