mirror of https://github.com/coturn/coturn
parent
c7a18c6296
commit
294f897ccd
@ -0,0 +1,74 @@ |
||||
# Author: Kang Lin (kl222@126.com) |
||||
# |
||||
# Find Prometheus. |
||||
# |
||||
# Set this variable to any additional path you want the module to search: |
||||
# Prometheus_DIR or Prometheus_ROOT |
||||
# |
||||
# Try to find prometheus |
||||
# Once done, this will define: |
||||
# Prometheus_FOUND - Prometheus (or all requested components of prom, promhttp, microhttpd) was found. |
||||
# Prometheus_INCLUDE_DIRS - Libevent include directories |
||||
# Prometheus_LIBRARIES - libraries needed to use Prometheus |
||||
# |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
|
||||
find_package(PkgConfig) |
||||
pkg_check_modules(PC_prom QUIET prom) |
||||
pkg_check_modules(PC_promhttp QUIET promhttp) |
||||
pkg_check_modules(PC_microhttd QUIET microhttpd) |
||||
|
||||
find_path(microhttpd_include_dir |
||||
NAMES microhttpd.h |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_microhttd_INCLUDE_DIRS} /usr |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES include |
||||
) |
||||
|
||||
find_library( |
||||
microhttpd_libs |
||||
NAMES microhttpd |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_microhttd_LIBRARY_DIRS} |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES lib ${CMAKE_INSTALL_LIBDIR}) |
||||
|
||||
find_path(prom_INCLUDE_DIR |
||||
NAMES prom.h |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_prom_INCLUDE_DIRS} /usr |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES include |
||||
) |
||||
|
||||
find_library( |
||||
prom_libs |
||||
NAMES prom |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_prom_LIBRARY_DIRS} |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES lib ${CMAKE_INSTALL_LIBDIR}) |
||||
|
||||
find_path(promhttp_INCLUDE_DIR |
||||
NAMES promhttp.h |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_promhttp_INCLUDE_DIRS} /usr |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES include |
||||
) |
||||
|
||||
find_library( |
||||
promhttp_libs |
||||
NAMES promhttp |
||||
HINTS ${Prometheus_DIR} ${Prometheus_ROOT} ${PC_promhttp_LIBRARY_DIRS} |
||||
PATHS $ENV{Prometheus_DIR} $ENV{Prometheus_ROOT} |
||||
PATH_SUFFIXES lib ${CMAKE_INSTALL_LIBDIR}) |
||||
|
||||
find_package_handle_standard_args(Prometheus |
||||
REQUIRED_VARS prom_libs prom_INCLUDE_DIR |
||||
promhttp_libs promhttp_INCLUDE_DIR |
||||
microhttpd_include_dir microhttpd_libs |
||||
) |
||||
|
||||
set(Prometheus_INCLUDE_DIRS |
||||
${prom_INCLUDE_DIR} |
||||
${promhttp_INCLUDE_DIR} |
||||
${microhttpd_include_dir}) |
||||
set(Prometheus_LIBRARIES ${prom_libs} ${promhttp_libs} ${microhttpd_libs}) |
||||
@ -0,0 +1,53 @@ |
||||
# Prometheus setup |
||||
|
||||
It is need the following libraries: |
||||
|
||||
- prometheus-client-c |
||||
- libmicrohttpd |
||||
|
||||
## Ubuntu |
||||
|
||||
### Install libmicrohttpd |
||||
|
||||
``` |
||||
sudo apt install libmicrohttpd-dev |
||||
``` |
||||
|
||||
## Install From source code |
||||
|
||||
- [libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/) |
||||
|
||||
Download from https://git.gnunet.org/libmicrohttpd.git |
||||
|
||||
``` |
||||
git clone https://git.gnunet.org/libmicrohttpd.git |
||||
``` |
||||
|
||||
- [prometheus-client-c](https://github.com/digitalocean/prometheus-client-c) |
||||
|
||||
Download from https://github.com/digitalocean/prometheus-client-c.git |
||||
|
||||
``` |
||||
git clone https://github.com/digitalocean/prometheus-client-c.git |
||||
``` |
||||
|
||||
## Build |
||||
|
||||
- Build libmicrohttpd from source code |
||||
|
||||
``` |
||||
git clone https://git.gnunet.org/libmicrohttpd.git |
||||
cd libmicrohttpd |
||||
./autogen.sh |
||||
./configure --prefix=`pwd`/install --disable-doc --disable-examples \ |
||||
--disable-tools |
||||
make install |
||||
``` |
||||
|
||||
- Build prometheus-client-c from source code |
||||
|
||||
``` |
||||
git clone https://github.com/digitalocean/prometheus-client-c.git |
||||
cd prometheus-client-c |
||||
make |
||||
``` |
||||
Loading…
Reference in new issue