-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
43 lines (27 loc) · 1.15 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
cmake_minimum_required (VERSION 2.6)
project ("varnish-influxdb")
set (VERSION_MAJOR 0)
set (VERSION_MINOR 1)
# set (CMAKE_BUILD_TYPE Release)
add_definitions(-Wall -Werror -pthread)
set (CMAKE_VERBOSE_MAKEFILE true)
# Keep RPATH to /usr/lib/varnish(-plus)/ on installed binaries.
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
find_package(PkgConfig)
pkg_check_modules(VARNISH REQUIRED varnishapi)
if(${VARNISH_VERSION} VERSION_LESS 4.1 )
message(FATAL_ERROR "Varnish 4.1 or newer is required")
endif()
# Look up keys in pkg-config that pkg_check_modules() doesn't populate.
find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
#message(STATUS "is " ${VARNISH_VMODTOOL} " end")
message(STATUS "is " ${VARNISH_LIBDIR} " end")
add_definitions(${VARNISH_CFLAGS})
include_directories("${PROJECT_BINARY_DIR}")
include_directories("src")
add_executable(influxstat src/influxstat.c)
# we need VSB_* from libvarnish, but no pkg-config for it.
target_link_libraries(influxstat /usr/lib/varnish/libvarnish.so)
target_link_libraries(influxstat m)
target_link_libraries(influxstat ${VARNISH_LIBRARIES})
install (PROGRAMS influxstat RENAME varnish-influxstat DESTINATION bin)