Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ endif()

find_package(ZLIB REQUIRED)

# ncurses is used in traffic_top
find_package(Curses)
set(HAVE_CURSES_H ${CURSES_HAVE_CURSES_H})
set(HAVE_NCURSES_H ${CURSES_HAVE_NCURSES_H})
set(HAVE_NCURSES_CURSES_H ${CURSES_HAVE_NCURSES_CURSES_H})
set(HAVE_NCURSES_NCURSES_H ${CURSES_HAVE_NCURSES_NCURSES_H})

include(Check128BitCas)
include(ConfigureTransparentProxy)

Expand Down Expand Up @@ -388,6 +395,13 @@ add_subdirectory(src/traffic_crashlog)
add_subdirectory(src/traffic_server)
add_subdirectory(src/traffic_ctl)
add_subdirectory(src/traffic_layout)
add_subdirectory(src/traffic_cache_tool)
add_subdirectory(src/traffic_logcat)
add_subdirectory(src/traffic_logstats)
if(CURSES_FOUND)
add_subdirectory(src/traffic_top)
endif()
add_subdirectory(src/traffic_via)
if(ENABLE_WCCP)
add_subdirectory(src/wccp)
add_subdirectory(src/traffic_wccp)
Expand Down
4 changes: 4 additions & 0 deletions include/tscore/ink_config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

#cmakedefine HAVE_BROTLI_ENCODE_H 1
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_CURSES_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NCURSES_CURSES_H 1
#cmakedefine HAVE_NCURSES_NCURSES_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_LZMA_H 1
Expand Down
1 change: 0 additions & 1 deletion proxy/http/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ target_link_libraries(test_http
PRIVATE
catch2::catch2
ts::http
ts::tsapi
ts::hdrs # transitive
logging # transitive
http_remap # transitive
Expand Down
14 changes: 1 addition & 13 deletions proxy/http3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,5 @@ add_library(http3 STATIC
add_library(ts::http3 ALIAS http3)

target_include_directories(http3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(http3 PUBLIC ts::quic PRIVATE ts::proxy)

target_link_libraries(http3
PUBLIC
ts::hdrs
ts::http
ts::inknet
ts::inkutils
ts::inkevent
ts::proxy
ts::quic
ts::records
ts::tscpputil
ts::tscore
)
2 changes: 2 additions & 0 deletions src/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

add_library(tsapi SHARED Metrics.cc)
add_library(ts::tsapi ALIAS tsapi)
target_link_libraries(tsapi PRIVATE ts::tscore)


install(TARGETS tsapi)

Expand Down
24 changes: 24 additions & 0 deletions src/traffic_cache_tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#######################
#
# 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.
#
#######################

add_executable(traffic_cache_tool
CacheDefs.cc
CacheTool.cc
CacheScan.cc)

target_link_libraries(traffic_cache_tool PRIVATE ts::tscore libswoc)
install(TARGETS traffic_cache_tool)
20 changes: 20 additions & 0 deletions src/traffic_logcat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#######################
#
# 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.
#
#######################

add_executable(traffic_logcat logcat.cc)
target_link_libraries(traffic_logcat PRIVATE ts::tscore ts::proxy ts::logging ts::hdrs ts::tsapi ts::diagsconfig libswoc)
install(TARGETS traffic_logcat)
31 changes: 31 additions & 0 deletions src/traffic_logstats/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#######################
#
# 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.
#
#######################

add_executable(traffic_logstats logstats.cc)
target_link_libraries(traffic_logstats PRIVATE ts::logging ts::hdrs ts::tscore ts::tsapi ts::records ts::diagsconfig ts::inkevent libswoc)

add_test(
NAME test_logstats_json
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_logstats_json ${CMAKE_SOURCE_DIR}/src
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
)

add_test(
NAME test_logstats_summary
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_logstats_summary ${CMAKE_SOURCE_DIR}/src
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
)
4 changes: 4 additions & 0 deletions src/traffic_logstats/tests/test_logstats_json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

set -e # exit on error

if [ ! -z $1 ]; then
srcdir=$1
fi

TMPDIR=${TMPDIR:-/tmp}
tmpfile=$(mktemp "$TMPDIR/logstats.XXXXXX")
srcdir=$(cd $srcdir && pwd)/traffic_logstats
Expand Down
6 changes: 5 additions & 1 deletion src/traffic_logstats/tests/test_logstats_summary
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
# limitations under the License.

set -e # exit on error
set -x # turn on debug
#set -x # turn on debug

if [ ! -z $1 ]; then
srcdir=$1
fi

TMPDIR=${TMPDIR:-/tmp}
tmpfile=$(mktemp "$TMPDIR/logstats.XXXXXX")
Expand Down
21 changes: 21 additions & 0 deletions src/traffic_top/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#######################
#
# 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.
#
#######################

add_executable(traffic_top traffic_top.cc ${CMAKE_SOURCE_DIR}/src/shared/rpc/IPCSocketClient.cc)
target_include_directories(traffic_top PRIVATE ${CURSES_INCLUDE_DIRS})
target_link_libraries(traffic_top PRIVATE ts::tscore ts::inkevent libswoc ${CURSES_LIBRARIES})
install(TARGETS traffic_top)
27 changes: 27 additions & 0 deletions src/traffic_via/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#######################
#
# 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.
#
#######################

add_executable(traffic_via traffic_via.cc)
target_link_libraries(traffic_via ts::tscore libswoc)
install(TARGETS traffic_via)

# Odd test to maintain compatibility with autotools. This could be better.
add_test(
NAME test_traffic_via
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_traffic_via ${CMAKE_SOURCE_DIR}/src
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
)
6 changes: 5 additions & 1 deletion src/traffic_via/test_traffic_via
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

set -e # exit on error

if [ ! -z $1 ]; then
srcdir=$1
fi

TMPDIR=${TMPDIR:-/tmp}
tmpfile=$(mktemp "$TMPDIR/via.XXXXXX")
if [ ! -z "$srcdir"]; then
if [ ! -z "$srcdir" ]; then
srcdir=$(cd $srcdir && pwd)
else
srcdir=$(pwd)
Expand Down
1 change: 1 addition & 0 deletions src/traffic_wccp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
#######################

add_executable(traffic_wccp wccp_client.cc)
install(TARGETS traffic_wccp)

target_link_libraries(traffic_wccp PRIVATE tscore wccp)