summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
blob: 7a57bbf4108f0c05411d473b4b317e79fc8e3471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if(ENABLE_EXAMPLES)
  file(GLOB c_sources *.c)
  set_source_files_properties(${c_sources} PROPERTIES
    COMPILE_FLAGS "${WARNCFLAGS}")
  file(GLOB cxx_sources *.cc)
  set_source_files_properties(${cxx_sources} PROPERTIES
    COMPILE_FLAGS "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}")

  include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
    "${CMAKE_CURRENT_SOURCE_DIR}/../third-party"
    "${CMAKE_CURRENT_SOURCE_DIR}/../third-party/llhttp/include"

    ${LIBEVENT_INCLUDE_DIRS}
    ${OPENSSL_INCLUDE_DIRS}
  )

  link_libraries(
    nghttp2
    ${LIBEVENT_OPENSSL_LIBRARIES}
    ${OPENSSL_LIBRARIES}
    ${APP_LIBRARIES}
  )

  add_executable(client           client.c $<TARGET_OBJECTS:llhttp>
    $<TARGET_OBJECTS:url-parser>
  )
  add_executable(libevent-client  libevent-client.c $<TARGET_OBJECTS:llhttp>
    $<TARGET_OBJECTS:url-parser>
  )
  add_executable(libevent-server  libevent-server.c $<TARGET_OBJECTS:llhttp>
    $<TARGET_OBJECTS:url-parser>
  )
  add_executable(deflate          deflate.c $<TARGET_OBJECTS:llhttp>
    $<TARGET_OBJECTS:url-parser>
  )
endif()