Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Support building with local dependencies (no Hunter) #46

Closed

Conversation

ringerc
Copy link
Contributor

@ringerc ringerc commented Jan 28, 2018

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.
    (no bug opened yet)

  • will fail to compile tests if the local thrift is 0.9.1 since there are
    committed generated files from 0.9.2 (Thrift IDL not in main repository, no build support #45) and there's no mechanism
    to regenerate them.

The nlohmann json issue is beyond my C++-fu, but it's easy enough to install 2.1.x and it's just a header. A pain, but manageable.

The Thrift issue #45 is a bit more of an issue; I'm on Fedora 25 with 0.9.1 right now, but Fedora Extras for RHEL7 also carries 0.9.1. More to the point, it's probably bad to rely on a code generator's output being compatible across multiple versions of its library.

@ringerc
Copy link
Contributor Author

ringerc commented Jan 28, 2018

Hrm, would also have to add support for non-hunter Travis builds before mergeable.

Copy link
Contributor

@isaachier isaachier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. I will wait to approve until you get build to work. Also, we can potentially add a Travis CI build with no Hunter to see how this works.

CMakeLists.txt Outdated
@@ -59,12 +59,12 @@ list(APPEND package_deps thrift)
hunter_add_package(opentracing-cpp)
# Not `${hunter_config}` because OpenTracing provides its own
# OpenTracingConfig.cmake file
find_package(OpenTracing CONFIG REQUIRED)
list(APPEND LIBS OpenTracing::opentracing-static)
find_package(OpenTracing ${hunter_config} REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

CMakeLists.txt Outdated
@@ -283,7 +287,7 @@ if(BUILD_TESTING)
GTEST_HAS_TR1_TUPLE=0
GTEST_USE_OWN_TR1_TUPLE=0)
target_link_libraries(
UnitTest testutils GTest::main jaegertracing-static ${LIBS})
UnitTest testutils ${GTEST_MAIN_LIBRARY} jaegertracing-static ${LIBS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is compatible with Hunter. May need to do something like this:

if(HUNTER_ENABLED)
  set(gtest_lib GTest::main)
else()
  set(gtest_lib ${GTEST_MAIN_LIBRARY})
endif()

#include <json.hpp>
#else
#include <nlohmann/json.hpp>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Another possibility is including the header somewhere because I think it is a header-only library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from latest push since cpp-client doesn't build against older headers due to code compat issues anyway (#47)

target_link_libraries(testutils thrift::thrift_static)
else()
target_link_libraries(testutils ${THRIFT_LIBRARIES})
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@ringerc
Copy link
Contributor Author

ringerc commented Jan 28, 2018

No major changes in this push, no need to re-examine.

Will try to address the Thrift stuff but am rapidly running out of time for what was going to be a 1-day prototype. I can't even link it to postgres yet :( so may have to abandon and grab Zipkin or something for now.

Isaac Hier added 2 commits January 28, 2018 08:25
Signed-off-by: Isaac Hier <ihier@uber.com>
Signed-off-by: Isaac Hier <ihier@uber.com>
@ringerc
Copy link
Contributor Author

ringerc commented Jan 29, 2018 via email

@ringerc ringerc force-pushed the local-dependencies-support branch 4 times, most recently from ea04e69 to 12990de Compare January 31, 2018 06:15
@ringerc
Copy link
Contributor Author

ringerc commented Jan 31, 2018

Pushed new commits. In particular I've now added the docs on top, since they didn't make much sense without local dependencies support.

I don't think I can get Travis support in too simply because of the quirky dependencies on Thrift and json-cpp. But anyway, it works...

@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

I landed up mostly rewriting the build system to make this work fairly cleanly. It now follows https://rix0r.nl/blog/2015/08/13/cmake-guide/ practices: modular CMakeLists.txt, uses IMPORT targets, etc. You'll find it a lot easier to follow and work with, and it doesn't have to special case stuff for Hunter anymore.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

I also got rid of the testutils subproject, instead building them as part of the test executables.

I haven't looked closely at how to do a local-dependencies build in Travis yet. The usual technique would be listing package dependencies but the very specific Thrift dependency and very new json dependency make that impractical.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

Hrm, the unit tests fail for some reason...

@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

Test failures were due to finding the installed headers. Fixed.

@codecov
Copy link

codecov bot commented Feb 1, 2018

Codecov Report

Merging #46 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   88.51%   88.46%   -0.05%     
==========================================
  Files          93       93              
  Lines        2246     2246              
==========================================
- Hits         1988     1987       -1     
- Misses        258      259       +1
Impacted Files Coverage Δ
src/jaegertracing/UDPTransport.cpp 91.83% <0%> (-2.05%) ⬇️
src/jaegertracing/reporters/RemoteReporter.cpp 73.33% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d49317...2022642. Read the comment docs.

@ringerc ringerc force-pushed the local-dependencies-support branch 2 times, most recently from cf01f4c to 791c136 Compare February 1, 2018 07:50
@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

@isaachier OK, think we're good to go :)

I fixed the coverage issue.

CMakeLists.txt Outdated
else()
list(APPEND LIBS ${THRIFT_LIBRARIES})
find_package(thrift 0.9.2 ${hunter_config} REQUIRED)
if(thrift_VERSION VERSION_GREATER "0.9.3")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add OR VERSION_LESS "0.9.2".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's handled by find_package. It doesn't have good support for saying "these two versions ONLY" hence the warning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I guess my point is that find_package works differently with Hunter vs. non-Hunter.

Here's a brief overview. CMake offers two ways of finding packages (and maybe a third but IDK about it): modules and configs. Modules refer to the Find<Package> modules that you added here and that many people use in CMake builds. The problem is inherent redundancy of many projects. Why does everyone need to add these modules? So CMake offered another approach whereby the package declares its location during its CMake build, then other packages can easily locate it. The latter method is called the config approach.

Hunter relies SOLELY on the config approach. That means none of your Find<Package> files will be called at all. Relying on any code in there isn't going to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I realise that. That's why ${hunter_config} substitutes the CONFIG option to find_package.

Have a look at the CMake package config files CMake generates from the Hunter-built packages. You'll see that they add_library(blah SHARED IMPORT) and setting INTERFACE properties like INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_INCLUDE_DIRECTORIES on the resulting target. That's exactly what I'm doing in the Find packages too, to be consistent with CMake CONFIG mode. Look at the bundled CMake modules in /usr/share/cmake/Modules (or wherever yours are installed) e.g. FindGTest.cmake. You'll find that they also declare import targets and set properties on them for the library name, header paths, etc.

So it's not really to do with Hunter or non-Hunter. There are two things at play here:

  • Is it using CONFIG mode (as Hunter requests), MODULE mode where it only uses Find packages, or the default where it tries a module first then falls back to config-mode?

  • Does the resulting configuration created by a CONFIG file load or a Find module execution generate import-targets (new-style CMake), or just set variables (old-style CMake)?

What I've done is written the Find modules to produce the same import targets, etc, as what you get from loading the CONFIG module. So it all "Just Works". It's done how CMake's own bundled modules do it.

None of this is helped by the fairly erratic CMake documentation, but have a look at:

CMake takes care of the dependency chains, adding link libraries and include paths when you reference an import target, etc. It uses the properties set on the target for this. There's no need for a LIBS variable or any of that anymore.

This is also why the build-tree passed to headers in target_include_directories are PRIVATE and the install-path headers are INTERFACE. This tells CMake not to include the build-tree headers in the CMake config file it generates. And to add the install-target headers in the config file, but not use them when compiling the package its self, since it won't be installed yet.

CMake really needs a docs section that properly explains PRIVATE, PUBLIC and INTERFACE, explains IMPORT targets and how they're used in Find modules, etc. It's there, you just have to find all the scattered pieces from the docs and work out the whole picture from it. Dealing with this has been a massive pain, but hopefully it's nearly done.

Copy link
Contributor

@isaachier isaachier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I see the changes and how they worked for you. The problem is merging this will break the Hunter build, which is currently the default. I'll try tweaking this to make it compatible with both. Good work and thanks for more docs!

CMakeLists.txt Outdated
project(jaegertracing VERSION 0.3.0)
project(jaegertracing VERSION 0.3.0 LANGUAGES CXX)

include(GNUInstallDirs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good catch.

CMakeLists.txt Outdated
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
set(boost_components regex)
hunter_add_package(Boost COMPONENTS regex)
list(APPEND LIBS Boost::regex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break the Hunter build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, if there's a library to link assocated with Boost::regex (for old compilers where it's not header-only, apparently) it's specified using target_link_libraries for jaegertracing.

Though come to think of it, that should be unconditional. On newer g++ the Boost::regex target will be an INTERFACE library instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure why the build uses hunter_add_package(Boost COMPONENTS regex) for older gcc, and simply hunter_add_package(Boost) for newer. That seems ... weird. Wouldn't you just always ask for Boost::regex with COMPONENTS regex ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the reason for that is the header-only vs. library dependencies in Boost. Hunter needs to know which libraries it is going to build. I'd rather not build or use the regex library from Boost if standard C++11 regex is available.

ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
INCLUDES DESTINATION "${include_install_dir}"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move, not remove. Installation of the library target is in the library's own CMakeLists.txt in src/jaegertracing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

CMakeLists.txt Outdated
@@ -371,3 +129,12 @@ install(
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}"
)

option(BUILD_TESTING "Build unit test" ON)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is built-in to CMake. No need to redeclare.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. My last significant CMake experience was a long time ago.

Copy link
Contributor

@isaachier isaachier Feb 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries :). I see this in many projects and always wonder why they don't use the built-in variable.

CMakeLists.txt Outdated
option(BUILD_TESTING "Build unit test" ON)
if (BUILD_TESTING)
enable_testing()
add_custom_target(check COMMAND echo "run make test instead")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

git clone https://github.com/jaegertracing/cpp-client.git jaeger-cpp-client
mkdir jaeger-cpp-build
cd jaeger-cpp-build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/jaeger-cpp-client ../jaeger-cpp-client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command should still work with existing install directives.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean this seems to imply the user must specify a prefix. It is optional, not a must.


void teardownTracing()
{
opentracing::Tracer::Global()->Close
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS if you don't close the tracer you might not flush all spans. But I guess it depends on the implementation details I haven't been able to dig into yet about whether any caching and delays are present for sending span closes.

I'd argue it's good practice; if you don't have to now, you probably will later when it starts buffering spans and sending them in chunks to reduce syscall overheads, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you are correct:

  // Close is called when a tracer is finished processing spans. It is not
  // required to be called and its effect is unspecified. For example, an
  // implementation might use this function to flush buffered spans to its
  // recording system and failing to call it could result in some spans being
  // dropped.

https://github.com/opentracing/opentracing-cpp/blob/master/include/opentracing/tracer.h#L147

README.md Outdated

It's possible to use `jaeger-cpp` from C with appropriate `extern "C"` thunks
and care around resource lifetime management etc. A real world example is the
support for opentracing and jaeger in ngnix; see
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: nginx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

# Build the jaegertracing library its self
cmake_minimum_required(VERSION 3.3)

project(libjaegertracing VERSION ${jaegertracing_VERSION} LANGUAGES CXX)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bad idea. It should all be one project. Not sure why splitting at all TBH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate project: convenience and seems to be standard practice with cmake, but I don't feel strongly about it.

Splitting at all: readability, maintainability, separation of concerns. The tests don't intermix with the main library and trample on its settings, etc.

See also https://rix0r.nl/blog/2015/08/13/cmake-guide/ and many others.

If I land up adopting this seriously I'll probably send a followup pull to extract the test sources into a separate subtree and ensure there's zero inclusion of test sources by non-test code, really make the boundary clear. I'll also submit another to pull the thrift generated code out of the source tree and build it on demand, something that'll be much easier with the possible fix to #45 I've been looking at.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen splitting the CMakeLists.txt file into multiple subdirectories, but I guess not subprojects. I see it is allowed in the link you pointed out, just hope it doesn't mess with other dependencies, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll remove the subproject

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ringerc
Copy link
Contributor Author

ringerc commented Feb 1, 2018

@isaachier It passes Hunter builds in CI and on my local machine. I spent a fair while preserving that and making everything uniform.

The CI tests listed as passing on this pull used Hunter, not local builds.

@ringerc ringerc force-pushed the local-dependencies-support branch 2 times, most recently from 95ba04e to 0d999a0 Compare February 2, 2018 04:17
@ringerc
Copy link
Contributor Author

ringerc commented Feb 7, 2018

@isaachier Any thoughts?

@isaachier
Copy link
Contributor

Sorry for delay here. I'd like to try this along with the changes in #48. Can you copy the modified Travis files there to allow for testing with and without Hunter?

Restructure the build system to follow CMake conventions: use import
libraries consistently, separate CMakeLists.txt for targets, etc.

Add Find packages to discover local dependencies not already supported
by CMake natively. These are used when Hunter is disabled to allow
jaeger cpp-client to use locally installed libraries.

This is a preliminary step in splitting the test sources out of the
library.

Improves jaegertracing#38 Offline builds

This introduces support for building with

   cmake -DHUNTER_ENABLED=0

Limitations for local dependency builds:

  - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY,
    not newer or older. These versions are not widely packaged
    so a local install is necessary.  (jaegertracing#45)

  - Requires nlohmann json 2.1.0 or newer, which is not widely
    packaged in Linux distros. Install a local copy. (jaegertracing#47)

Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
@ringerc
Copy link
Contributor Author

ringerc commented Feb 13, 2018

@isaachier I merged the Travis files as requested

@isaachier
Copy link
Contributor

I owe you a full review soon. Will get around to it ASAP.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 14, 2018 via email

@isaachier
Copy link
Contributor

That makes sense, but the issue is that a team at Uber uses Bazel for their build, not CMake, and the fix is primarily for them. Not sure if they can use a CMake based macro. Then again, I think they hack a lot of it at the moment to get it working so not a huge deal.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 14, 2018 via email

@isaachier
Copy link
Contributor

Right lol I get that. Ironically, Hunter supports autotools and maintains a PostgreSQL build, so you could probably leverage that somehow in a worst case scenario. Either way, my support for GCC 4.8 and below is declining. nlohmann specifically won't work on 4.8. There are some patches the team I work with used but I'd recommend not using them.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 14, 2018 via email

@isaachier
Copy link
Contributor

Ya I'm sorry again and not entirely surprised. This library was built for a very modern C++ application. That's why I've been working on a C version - - to reduce dependencies and increase portability.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 15, 2018 via email

@isaachier
Copy link
Contributor

@ringerc no worries. Eventually, I hope to remove much of the C++ internals from the C++ client, wrapping the C core instead. In that case, your code would work fine, even if not using C directly. When it gets to that level of maturity, I'll be sure to let you know.

@ringerc
Copy link
Contributor Author

ringerc commented Feb 15, 2018 via email

Copy link
Contributor

@isaachier isaachier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ringerc I think this change is a bit outdated and quite large. I am sorry I have not reviewed it adequately. If you do intend to change this, please update pull request and reopen it once you do. I suggest keeping the CMake build in one file if you don't mind. In my opinion, splitting the CMake file into different directories works best when the build is independent in each directory and the libraries require different options. Here, I don't see that being the case.

@isaachier isaachier closed this Mar 26, 2018
@isaachier isaachier mentioned this pull request Apr 5, 2018
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 20, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 20, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
@ideepika ideepika mentioned this pull request Mar 20, 2020
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 20, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 20, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 26, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ideepika/jaeger-client-cpp that referenced this pull request Mar 31, 2020
even after json package installed using distro package, cmake
is not able to search for it's cmake config, adding a find_package
method ensures garanteed check on finding dependency, which is either
skipped or not discovered.

Reference:

CMake Error at CMakeLists.txt:80 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

Adapted from: jaegertracing#46
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants