forked from jplevyak/trafficserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
129 lines (113 loc) · 4.21 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#### EDITOR SUPPORT ####
## This file exists ONLY to support code editors (e.g. Visual Code, CLion).
##
## !!!-> IT WILL NOT BUILD TRAFFIC SERVER <-!!!
##
## This file can be tweaked to keep editors happy. In general all projects should be defined here so
## there is only one instance of this file, not one per directory. This has been done only to the
## extent that someone using such an editor needed it, so much work is left to be done.
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################
cmake_minimum_required(VERSION 3.7)
project(ats)
set(CMAKE_CXX_STANDARD 17)
include_directories(
include
tests/include
lib
lib/yamlcpp/include
proxy
proxy/hdrs
proxy/http
proxy/http/remap
proxy/shared
iocore/eventsystem
iocore/net
iocore/dns
iocore/hostdb
iocore/aio
iocore/cache
iocore/utils
mgmt
mgmt/api
mgmt/utils
mgmt/api/include
proxy/api)
macro(CC_EXEC exec path)
file(GLOB cc_exec_files ${path}/*.cc ${path}/*.h)
add_executable(${exec} ${cc_exec_files})
endmacro(CC_EXEC)
macro(CPP_LIB name src_path inc_path)
file(GLOB cc_lib_files ${inc_path}/*.h ${src_path}/*.cc ${src_path}/*.h ${src_path}/unit_tests/*.cc)
add_library(${name} SHARED ${cc_lib_files})
endmacro(CPP_LIB)
macro(CPP_ADD_SOURCES target path)
file(GLOB cpp_add_src_files ${path}/*.h ${path}/*.cc)
target_sources(${target} PUBLIC ${cpp_add_src_files})
endmacro(CPP_ADD_SOURCES)
CC_EXEC(traffic_cache_tool src/traffic_cache_tool)
CC_EXEC(traffic_crashlog src/traffic_crashlog)
CC_EXEC(traffic_ctl src/traffic_ctl)
CC_EXEC(traffic_layout src/traffic_layout)
CC_EXEC(traffic_logcat src/traffic_logcat)
CC_EXEC(traffic_logstats src/traffic_logstats)
CC_EXEC(traffic_manager src/traffic_manager)
CC_EXEC(traffic_server src/traffic_server)
CC_EXEC(traffic_top src/traffic_top)
CC_EXEC(traffic_via src/traffic_via)
CC_EXEC(traffic_wccp src/traffic_wccp)
CPP_LIB(tscore src/tscore include/tscore)
CPP_LIB(tscpputil src/tscpp/util include/tscpp/util)
CPP_LIB(tscppapi src/tscpp/api include/tscpp/api)
CC_EXEC(test_tscore src/tscore/unit_tests)
CC_EXEC(test_tsutil src/tscpp/util/unit_tests)
CC_EXEC(test_librecords lib/records/unit_tests)
CPP_LIB(proxy proxy proxy)
CPP_ADD_SOURCES(proxy proxy/http)
CPP_ADD_SOURCES(proxy proxy/http/unit_tests)
CPP_ADD_SOURCES(proxy proxy/http2)
CPP_ADD_SOURCES(proxy proxy/http/remap)
CPP_ADD_SOURCES(proxy proxy/hdrs)
CPP_ADD_SOURCES(proxy proxy/hdrs/unit_tests)
CPP_ADD_SOURCES(proxy proxy/logging)
CPP_LIB(iocore iocore iocore)
CPP_ADD_SOURCES(iocore iocore/eventsystem)
CPP_ADD_SOURCES(iocore iocore/net)
CPP_ADD_SOURCES(iocore iocore/cache)
CPP_ADD_SOURCES(iocore iocore/aio)
CPP_ADD_SOURCES(iocore iocore/dns)
CPP_ADD_SOURCES(iocore iocore/hostdb)
CPP_ADD_SOURCES(iocore iocore/utils)
CPP_LIB(mgmt mgmt mgmt)
CPP_ADD_SOURCES(mgmt mgmt/api)
CPP_ADD_SOURCES(mgmt mgmt/utils)
CPP_LIB(records lib/records lib/records)
CPP_LIB(logging proxy/logging proxy/logging)
CPP_LIB(wccp src/wccp include/wccp)
file(GLOB plugin_files
plugins/*/*.h
plugins/*/*.c
plugins/*/*.cc
plugins/experimental/*/*.h
plugins/experimental/*/*.c
plugins/experimental/*/*.cc
example/*/*.h
example/*/*.c
example/*/*.cc
)
add_library(plugins SHARED ${plugin_files})
add_custom_target(clang-format WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} COMMAND make -j clang-format)