Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opentelemetry-cpp] build failure (Unknown CMake command "find_dependency") #31218

Closed
klalumiere opened this issue May 2, 2023 · 0 comments · Fixed by #31219
Closed

[opentelemetry-cpp] build failure (Unknown CMake command "find_dependency") #31218

klalumiere opened this issue May 2, 2023 · 0 comments · Fixed by #31219
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@klalumiere
Copy link
Contributor

Operating system

Ubuntu 22.04

Compiler

Clang

Steps to reproduce the behavior

`cmake -B build -S test_cpp_project` with a manifest `vcpkg.json`


{
    "name": "testcppproject",
    "version-string": "head",
    "overrides": [],
    "dependencies": [
        {
            "name": "opentelemetry-cpp",
            "version>=": "1.8.3#5",
            "features": [
                "otlp"
            ]
        }
    ]
}


a configuration file `vcpkg-configuration.json`

```json
{
    "default-registry": {
        "kind": "builtin",
        "baseline": "c74f7879a6bafc001f7668163b6db4588787f065"
    },
    "registries": []
}

and, inside CMakeLists.txt

find_package(opentelemetry-cpp CONFIG REQUIRED)


### Failure logs

```shell
CMake Error at /home/klalumiere/src/coveo/cpp/cmakelibrary/build/vcpkg_installed/x64-linux-dynamic/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake:86 (find_dependency):
  Unknown CMake command "find_dependency".
Call Stack (most recent call first):
  /home/klalumiere/src/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package)
  TestTarget/CMakeLists.txt:13 (find_package)

Additional context

I understand the error. We add find_dependency(absl) in opentelemetry-cpp-config.cmake.in, but we forgot include(CMakeFindDependencyMacro). I tested and adding manually include(CMakeFindDependencyMacro) mitigates the issue. I'll open a pull request in a few minutes that solves the issue.

@klalumiere klalumiere added the category:port-bug The issue is with a library, which is something the port should already support label May 2, 2023
klalumiere added a commit to coveo/vcpkg that referenced this issue May 2, 2023
JavierMatosD pushed a commit that referenced this issue May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants