2020-10-18 16:59:15 +00:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
2014-08-06 16:18:33 +00:00
|
|
|
project (crow_examples)
|
2015-02-20 20:46:28 +00:00
|
|
|
|
|
|
|
if (MSVC)
|
2020-10-19 08:02:57 +00:00
|
|
|
add_executable(example_vs example_vs.cpp)
|
|
|
|
target_link_libraries(example_vs ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(example_vs ${CMAKE_THREAD_LIBS_INIT})
|
2015-02-20 20:46:28 +00:00
|
|
|
else ()
|
2020-10-19 08:02:57 +00:00
|
|
|
add_executable(helloworld helloworld.cpp)
|
|
|
|
target_link_libraries(helloworld ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT})
|
2015-06-10 06:53:58 +00:00
|
|
|
|
2016-09-06 00:40:55 +00:00
|
|
|
if (OPENSSL_FOUND)
|
2020-10-19 08:02:57 +00:00
|
|
|
add_executable(example_ssl ssl/example_ssl.cpp)
|
|
|
|
target_link_libraries(example_ssl ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(example_ssl ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
|
2016-09-06 00:40:55 +00:00
|
|
|
endif()
|
2015-09-20 13:06:00 +00:00
|
|
|
|
2016-08-28 05:46:31 +00:00
|
|
|
add_executable(example_websocket websocket/example_ws.cpp)
|
|
|
|
target_link_libraries(example_websocket ${Boost_LIBRARIES})
|
2016-10-15 18:26:12 +00:00
|
|
|
target_link_libraries(example_websocket ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
|
2016-10-03 11:47:22 +00:00
|
|
|
add_custom_command(OUTPUT ws.html
|
2020-10-19 08:02:57 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html ${CMAKE_CURRENT_BINARY_DIR}/templates/ws.html
|
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html
|
2016-10-03 11:47:22 +00:00
|
|
|
)
|
|
|
|
add_custom_target(example_ws_copy ALL DEPENDS ws.html)
|
2016-08-28 05:46:31 +00:00
|
|
|
|
2014-08-06 16:18:33 +00:00
|
|
|
add_executable(example example.cpp)
|
2014-11-22 02:13:46 +00:00
|
|
|
target_link_libraries(example ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(example ${CMAKE_THREAD_LIBS_INIT})
|
2014-08-14 23:22:02 +00:00
|
|
|
|
|
|
|
if (Tcmalloc_FOUND)
|
2020-10-19 08:02:57 +00:00
|
|
|
target_link_libraries(example ${Tcmalloc_LIBRARIES})
|
2014-08-14 23:22:02 +00:00
|
|
|
endif(Tcmalloc_FOUND)
|
|
|
|
|
2014-10-23 16:20:19 +00:00
|
|
|
add_executable(example_with_all example_with_all.cpp)
|
2017-09-17 20:15:41 +00:00
|
|
|
add_dependencies(example_with_all amalgamation)
|
2014-11-22 02:13:46 +00:00
|
|
|
target_link_libraries(example_with_all ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(example_with_all ${CMAKE_THREAD_LIBS_INIT})
|
2014-10-23 16:20:19 +00:00
|
|
|
|
2014-08-06 19:46:28 +00:00
|
|
|
add_custom_command(OUTPUT example_test.py
|
2020-10-19 08:02:57 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${PROJECT_SOURCE_DIR}/example_test.py ${CMAKE_CURRENT_BINARY_DIR}/example_test.py
|
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/example_test.py
|
2016-10-03 11:47:22 +00:00
|
|
|
)
|
2014-08-06 19:46:28 +00:00
|
|
|
add_custom_target(example_copy ALL DEPENDS example_test.py)
|
2014-08-06 16:18:33 +00:00
|
|
|
|
|
|
|
add_executable(example_chat example_chat.cpp)
|
2014-11-22 02:13:46 +00:00
|
|
|
target_link_libraries(example_chat ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(example_chat ${CMAKE_THREAD_LIBS_INIT})
|
2014-08-06 16:18:33 +00:00
|
|
|
add_custom_command(OUTPUT example_chat.html
|
2020-10-19 08:02:57 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${PROJECT_SOURCE_DIR}/example_chat.html ${CMAKE_CURRENT_BINARY_DIR}/example_chat.html
|
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/example_chat.html
|
2016-10-03 11:47:22 +00:00
|
|
|
)
|
2014-08-06 16:18:33 +00:00
|
|
|
add_custom_target(example_chat_copy ALL DEPENDS example_chat.html)
|
2014-08-14 23:22:02 +00:00
|
|
|
|
2015-02-20 20:46:28 +00:00
|
|
|
endif()
|