Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cmake): Generate pkg-config files
Fixes: #447
- Loading branch information
Showing
14 changed files
with
167 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cmake_minimum_required(VERSION 3.12 FATAL_ERROR) | ||
|
||
project(prometheus-cpp-import) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
|
||
pkg_check_modules(PROMETHEUS_CPP_CORE REQUIRED prometheus-cpp-core) | ||
pkg_check_modules(PROMETHEUS_CPP_PUSH IMPORTED_TARGET prometheus-cpp-push) | ||
pkg_check_modules(PROMETHEUS_CPP_PULL IMPORTED_TARGET prometheus-cpp-pull) | ||
|
||
if(PROMETHEUS_CPP_PUSH_FOUND) | ||
add_executable(sample-client sample_client.cc) | ||
target_link_libraries(sample-client PRIVATE PkgConfig::PROMETHEUS_CPP_PUSH) | ||
endif() | ||
|
||
if(PROMETHEUS_CPP_PULL_FOUND) | ||
add_executable(sample-server sample_server.cc) | ||
target_link_libraries(sample-server PRIVATE PkgConfig::PROMETHEUS_CPP_PULL) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../push/tests/integration/sample_client.cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../pull/tests/integration/sample_server.cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
|
||
Name: @PROJECT_NAME@-core | ||
Description: @PROJECT_DESCRIPTION@ | ||
URL: @PROJECT_HOMEPAGE_URL@ | ||
Version: @PROJECT_VERSION@ | ||
Requires: | ||
Requires.private: @PKGCONFIG_REQUIRES@ | ||
Cflags: -I${includedir} | ||
Libs: -L${libdir} -l@PROJECT_NAME@-core | ||
Libs.private: @CMAKE_THREAD_LIBS_INIT@ @PKGCONFIG_LIBS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
|
||
Name: @PROJECT_NAME@-pull | ||
Description: @PROJECT_DESCRIPTION@ | ||
URL: @PROJECT_HOMEPAGE_URL@ | ||
Version: @PROJECT_VERSION@ | ||
Requires: @PROJECT_NAME@-core | ||
Requires.private: @PKGCONFIG_REQUIRES@ | ||
Cflags: -I${includedir} | ||
Libs: -L${libdir} -l@PROJECT_NAME@-pull | ||
Libs.private: @CMAKE_THREAD_LIBS_INIT@ @PKGCONFIG_LIBS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
|
||
Name: @PROJECT_NAME@-push | ||
Description: @PROJECT_DESCRIPTION@ | ||
URL: @PROJECT_HOMEPAGE_URL@ | ||
Version: @PROJECT_VERSION@ | ||
Requires: @PROJECT_NAME@-core | ||
Requires.private: @PKGCONFIG_REQUIRES@ | ||
Cflags: -I${includedir} | ||
Libs: -L${libdir} -l@PROJECT_NAME@-push | ||
Libs.private: @CMAKE_THREAD_LIBS_INIT@ @PKGCONFIG_LIBS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters