2019-09-26 11:33:58 +00:00
|
|
|
link_libraries(${PROJECT_NAME})
|
2019-08-08 07:17:09 +00:00
|
|
|
|
2019-08-31 00:27:57 +00:00
|
|
|
set(benchmark_sources benchmark/BenchmarkCtrl.cc benchmark/JsonCtrl.cc
|
|
|
|
benchmark/main.cc)
|
2018-07-24 09:24:23 +00:00
|
|
|
|
2021-05-27 12:09:57 +00:00
|
|
|
add_executable(client client_example/main.cc)
|
|
|
|
add_executable(websocket_client websocket_client/WebSocketClient.cc)
|
2021-08-04 04:48:42 +00:00
|
|
|
add_executable(websocket_server websocket_server/WebSocketServer.cc)
|
2019-08-08 07:17:09 +00:00
|
|
|
add_executable(benchmark ${benchmark_sources})
|
2021-06-01 08:08:51 +00: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 14:57:07 +00:00
|
|
|
|
2021-06-19 14:55:44 +00:00
|
|
|
add_executable(jsonstore jsonstore/main.cc)
|
|
|
|
|
2022-09-13 02:30:51 +00:00
|
|
|
add_executable(redis_simple redis/main.cc
|
|
|
|
redis/controllers/Client.cc
|
|
|
|
redis/controllers/WsClient.cc)
|
|
|
|
|
|
|
|
add_executable(redis_chat redis_chat/main.cc
|
|
|
|
redis_chat/controllers/Chat.cc)
|
|
|
|
|
2024-01-15 15:26:27 +00:00
|
|
|
add_executable(async_stream async_stream/main.cc)
|
|
|
|
|
2019-08-31 00:27:57 +00:00
|
|
|
set(example_targets
|
|
|
|
benchmark
|
2021-05-27 12:09:57 +00:00
|
|
|
client
|
2021-06-01 08:08:51 +00:00
|
|
|
websocket_client
|
2021-08-04 04:48:42 +00:00
|
|
|
websocket_server
|
2021-06-01 08:08:51 +00:00
|
|
|
helloworld
|
|
|
|
file_upload
|
2021-06-19 14:55:44 +00:00
|
|
|
login_session
|
2022-09-13 02:30:51 +00:00
|
|
|
jsonstore
|
|
|
|
redis_simple
|
2024-01-15 15:26:27 +00:00
|
|
|
redis_chat
|
|
|
|
async_stream)
|
2019-07-26 14:22:12 +00:00
|
|
|
|
2021-06-27 01:54:02 +00: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 00:27:57 +00:00
|
|
|
set_property(TARGET ${example_targets}
|
|
|
|
PROPERTY CXX_STANDARD ${DROGON_CXX_STANDARD})
|
2019-08-08 07:17:09 +00:00
|
|
|
set_property(TARGET ${example_targets} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
set_property(TARGET ${example_targets} PROPERTY CXX_EXTENSIONS OFF)
|