diff --git a/CMakeLists.txt b/CMakeLists.txt index d1857f1e..b0497d9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -508,8 +508,8 @@ add_subdirectory(lib) add_subdirectory(third-party) add_subdirectory(src) #add_subdirectory(src/includes) -if(0) add_subdirectory(examples) +if(0) add_subdirectory(python) add_subdirectory(tests) #add_subdirectory(tests/testdata) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 00000000..3802e7ce --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,54 @@ +if(ENABLE_EXAMPLES) + # XXX replace this by lists (WARNCFLAGS_list) + string(REPLACE " " ";" c_flags "${WARNCFLAGS}") + string(REPLACE " " ";" cxx_flags "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}") + add_compile_options( + "$<$:${c_flags}>" + "$<$:${cxx_flags}>" + ) + + include_directories( + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/includes + ${CMAKE_BINARY_DIR}/lib/includes + ${CMAKE_SOURCE_DIR}/src/includes + ${CMAKE_SOURCE_DIR}/third-party + + ${LIBEVENT_OPENSSL_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIRS} + ) + + link_libraries( + nghttp2 + ${LIBEVENT_OPENSSL_LIBRARIES} + ${OPENSSL_LIBRARIES} + ${APP_LIBRARIES} + ) + + add_executable(client client.c $) + add_executable(libevent_client libevent-client.c $) + add_executable(libevent_server libevent-server.c $) + add_executable(deflate deflate.c $) + + if(ENABLE_TINY_NGHTTPD) + add_executable(tiny-nghttpd tiny-nghttpd.c $) + endif() + + if(ENABLE_ASIO_LIB) + foreach(name asio-sv asio-sv2 asio-cl asio-cl2) + add_executable(${name} ${name}.cc $) + target_include_directories(${name} PRIVATE + ${OPENSSL_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ) + target_link_libraries(${name} + nghttp2 + nghttp2_asio + ${JEMALLOC_LIBRARIES} + ${OPENSSL_LIBRARIES} + ${Boost_LIBRARIES} + ${APP_LIBRARIES} + ) + endforeach() + endif() +endif()