forked from jaegertracing/jaeger-client-cpp
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support building with local dependencies (no Hunter)
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. (jaegertracing#47) - will fail to compile tests if the local thrift is 0.9.1 since there are committed generated files from 0.9.2 (jaegertracing#45) and there's no mechanism to regenerate them. This seeks to address the beginnings of jaegertracing#38. Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
- Loading branch information
Showing
7 changed files
with
112 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Find Thrift library and headers | ||
# | ||
# Sets: | ||
# | ||
# THRIFT_FOUND | ||
# THRIFT_INCLUDE_DIR | ||
# THRIFT_LIBRARIES | ||
# | ||
# Cut down from https://github.com/facebookarchive/fblualib | ||
|
||
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) | ||
|
||
FIND_LIBRARY(THRIFT_LIBRARIES thrift) | ||
FIND_PATH(THRIFT_INCLUDE_DIR "thrift/Thrift.h") | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( | ||
Thrift | ||
REQUIRED_ARGS | ||
THRIFT_INCLUDE_DIR | ||
THRIFT_LIBRARY | ||
THRIFT_CPP2_LIBRARY) |
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,39 @@ | ||
# Find jsoncpp | ||
# | ||
# Find the nlohmann json header | ||
# | ||
# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH | ||
# | ||
# This module defines | ||
# | ||
# nlohmann_json_INCLUDE_DIR, where to find header, etc. | ||
# | ||
# nlohmann_json_FOUND, If false, do not try to use jsoncpp. | ||
# | ||
# nlohmann_json_INCLUDE_NAME, the actual header name. You only have | ||
# to use this if you want to support 2.0.x which installs | ||
# a top-level json.hpp instead of nlohmann/json.hpp | ||
# | ||
|
||
# only look in default directories | ||
set(nlohmann_json_INCLUDE_NAME "nlohmann/json.hpp") | ||
find_path( | ||
nlohmann_json_INCLUDE_DIR | ||
NAMES "${nlohmann_json_INCLUDE_NAME}" | ||
DOC "nlohmann json include dir" | ||
) | ||
|
||
if (NOT nlohmann_json_INCLUDE_DIR) | ||
set(nlohmann_json_INCLUDE_NAME "json.hpp") | ||
find_path( | ||
nlohmann_json_INCLUDE_DIR | ||
NAMES "${nlohmann_json_INCLUDE_NAME}" | ||
) | ||
endif() | ||
|
||
set(nlohmann_json_INCLUDE_NAME ${nlohmann_json_INCLUDE_NAME} CACHE STRING "nlohmann header file name") | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set nlohmann_json_FOUND to TRUE | ||
# if all listed variables are TRUE, hide their existence from configuration view | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(nlohmann_json DEFAULT_MSG nlohmann_json_INCLUDE_DIR nlohmann_json_INCLUDE_NAME) |
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,25 @@ | ||
# Find the yaml-cpp header and libraries | ||
# | ||
# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH | ||
# | ||
# This module defines | ||
# yaml-cpp_INCLUDE_DIR, where to find header, etc. | ||
# yaml-cpp_LIBRARIES, libraries to link to use yaml-cpp | ||
# yaml-cpp_FOUND, If false, do not try to use yaml-cpp. | ||
# | ||
|
||
# only look in default directories | ||
find_path( | ||
yaml-cpp_INCLUDE_DIR | ||
NAMES yaml-cpp/yaml.h | ||
DOC "yaml-cpp include dir" | ||
) | ||
|
||
find_library(yaml-cpp_LIBRARIES | ||
NAMES yaml-cpp | ||
PATH_SUFFIXES lib lib64) | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set yaml-cpp_FOUND to TRUE | ||
# if all listed variables are TRUE, hide their existence from configuration view | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(yaml-cpp DEFAULT_MSG yaml-cpp_LIBRARIES yaml-cpp_INCLUDE_DIR) |
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