-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
69 lines (55 loc) · 2.01 KB
/
CMakeLists.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 2.6)
get_directory_property(hasParent PARENT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (hasParent)
set(http_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ext
${CMAKE_CURRENT_SOURCE_DIR}/ext/std
PARENT_SCOPE)
endif()
add_compile_options(-std=c++17 -fPIC -O3 -Werror -Wall -Wpedantic -isystem ext/std)
project(fmtlib)
file(GLOB SOURCES "ext/fmtlib/fmt/*.cc")
add_library(fmt STATIC ${SOURCES})
project(http-parser++)
file(GLOB SOURCES "ext/http-parser++/http-parser/http_parser.cc")
add_library(http-parser++ STATIC ${SOURCES})
project(gmock)
include_directories(ext/gmock)
include_directories(ext/gtest)
add_library(gmock STATIC ext/gtest/src/gtest-all.cc
ext/gmock/src/gmock-all.cc
ext/gmock/src/gmock_main.cc)
project(static_lib)
include_directories(ext/fmtlib)
include_directories(ext/http-parser++)
include_directories(include)
file(GLOB SOURCES "src/*.cc")
add_library(chili_static STATIC ${SOURCES})
target_link_libraries(chili_static fmt http-parser++ curl pthread unwind)
project(shared_lib)
add_library(chili SHARED "")
target_link_libraries(chili chili_static)
project(example_hello_world)
file(GLOB SOURCES "examples/hello_world.cc")
add_executable(hello_world ${SOURCES})
target_link_libraries(hello_world chili)
project(example_streamer)
file(GLOB SOURCES "examples/streamer.cc")
add_executable(streamer ${SOURCES})
target_link_libraries(streamer chili)
project(example_routed)
file(GLOB SOURCES "examples/routed.cc")
add_executable(routed ${SOURCES})
target_link_libraries(routed chili)
project(sandbox_echo)
add_executable(sandbox_echo "sandbox/echo.cc")
target_link_libraries(sandbox_echo chili)
project(tests)
include_directories(test)
file(GLOB SOURCES "test/*.cc")
add_executable(tests ${SOURCES})
target_link_libraries(tests chili gmock)