Skip to content

CMake error when building with CURL 8.3.0 and higher #2446

@fgallegosalido

Description

@fgallegosalido

Describe your environment Describe any aspect of your environment relevant to the problem, including your platform, build system, version numbers of installed dependencies, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main branch.

Ubuntu 20.04
CMake 3.18
Opentelemetry C++ 1.13.0
GCC 7.5.0
CURL 8.3.0

Steps to reproduce
Compile CURL 8.3.0 or higher. Then try to compile OpenTelemetry C++ with OTLP enabled (so that CURL is actually needed).

What is the expected behavior?
The code should compile without errors.

What is the actual behavior?
This is the error that CMake gives:

CMake Error at cmake/tools.cmake:186 (set_target_properties): set_target_properties can not be used on an ALIAS target. Call Stack (most recent call first): cmake/patch-imported-config.cmake:25 (project_build_tools_patch_default_imported_config) CMakeLists.txt:685 (include) CMake Error at cmake/tools.cmake:186 (set_target_properties): set_target_properties can not be used on an ALIAS target. Call Stack (most recent call first): cmake/patch-imported-config.cmake:25 (project_build_tools_patch_default_imported_config) CMakeLists.txt:685 (include) 

Additional context
I was able to find the exact commit where the build breaks: curl/curl@1199308

My intuition tells me that, by making the target CURL::libcurl an ALIAS, the CMake function project_build_tools_patch_default_imported_config in cmake/patch-imported-config.cmake doesn't work anymore, as it is trying to modify a target that is an ALIAS.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions