Skip to content

cmake: fix confusing error when a dependency is undetected in curl-config.cmake - #20737

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cmconfigdetmiss
Closed

cmake: fix confusing error when a dependency is undetected in curl-config.cmake#20737
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cmconfigdetmiss

Conversation

@vszakats

@vszakats vszakats commented Feb 26, 2026

Copy link
Copy Markdown
Member

Fixing:

CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
  get_target_property() called with non-existent target "CURL::libssh2".

and replacing it with the clearer message:

CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
  The link interface of target "CURL::libcurl_static" contains:

    CURL::libssh2

  but the target was not found.  Possible reasons include:
[...]

Reported-by: Val S.
Ref: #20729
Follow-up to 16f073e #16973


https://github.com/curl/curl/pull/20737/files?w=1

@vszakats vszakats added the cmake label Feb 26, 2026
@github-actions github-actions Bot added the build label Feb 26, 2026
@vszakats vszakats changed the title cmake: try improve error message when dependency is undetected in curl-config.cmake cmake: fix confusing error when a dependency is undetected in curl-config.cmake Feb 26, 2026
@vszakats vszakats closed this in fb58b23 Feb 26, 2026
@vszakats
vszakats deleted the cmconfigdetmiss branch February 26, 2026 18:45
@vszakats

vszakats commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

Maybe useful information that this bug happened in compatibility
code specifically written for old cmake versions, and planned to be
dropped via #20407.

outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
…onfig.cmake`

Fixing:
```
CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
  get_target_property() called with non-existent target "CURL::libssh2".
```
and replacing it with the clearer message:
```
CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
  The link interface of target "CURL::libcurl_static" contains:

    CURL::libssh2

  but the target was not found.  Possible reasons include:
[...]
```

Reported-by: Val S.
Ref: curl#20729
Follow-up to 16f073e curl#16973

Closes curl#20737
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant