Skip to content

cmake/Find: set <Modulename>_FOUND for compatibility when found via pkg-config#16153

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cm-find-alt-found
Closed

cmake/Find: set <Modulename>_FOUND for compatibility when found via pkg-config#16153
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cm-find-alt-found

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Feb 2, 2025

For Find modules where <Modulename> is not fully uppercase.

<Modulename> is case-exact name used in the Find modules filename:
CMake/Find<Moduleame>.cmake.

find_package_handle_standard_args() sets both <MODULENAME>_FOUND and
<Modulename>_FOUND when detecting the dependency. Some CMake code
relies on this and 3rd-party code may rely on it too. Make sure to set
the latter variant when detecting the dependency via pkg-config, where
we don't call find_package_handle_standard_args().

CMake sets these variable to TRUE (not ON or 1). Replicate this
for compatibility.

… `pkg-config`

For Find modules where `<modulename>` is not fully uppercase.

`find_package_handle_standard_args()` sets both `<MODULENAME>_FOUND` and
`<Modulename>_FOUND` when detecting the dependency. Some CMake code
relies on this and 3rd-party code may rely on it too. Make sure to set
the latter variant when detecting the dependency via `pkg-config`, where
we don't call `find_package_handle_standard_args()`.

CMake sets these variable to `TRUE` (not `ON` or `1`). Replicate this
for compatibility.
@vszakats vszakats added the cmake label Feb 2, 2025
@github-actions github-actions Bot added the build label Feb 2, 2025
@vszakats vszakats changed the title cmake/Find: set <modulename>_FOUND for compatibility when found via… cmake/Find: set <modulename>_FOUND for compatibility when found via pkg-config Feb 2, 2025
@vszakats vszakats marked this pull request as draft February 2, 2025 14:07
@vszakats vszakats marked this pull request as ready for review February 3, 2025 03:24
@vszakats vszakats changed the title cmake/Find: set <modulename>_FOUND for compatibility when found via pkg-config cmake/Find: set <Modulename>_FOUND for compatibility when found via pkg-config Feb 3, 2025
@vszakats vszakats closed this in 2b9b3ec Feb 6, 2025
@vszakats vszakats deleted the cm-find-alt-found branch February 6, 2025 23:08
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
… `pkg-config`

For Find modules where `<Modulename>` is not fully uppercase.

`<Modulename>` is case-exact name used in the Find modules filename:
`CMake/Find<Moduleame>.cmake`.

`find_package_handle_standard_args()` sets both `<MODULENAME>_FOUND` and
`<Modulename>_FOUND` when detecting the dependency. Some CMake code
relies on this and 3rd-party code may rely on it too. Make sure to set
the latter variant when detecting the dependency via `pkg-config`, where
we don't call `find_package_handle_standard_args()`.

CMake sets these variable to `TRUE` (not `ON` or `1`). Replicate this
for compatibility.

Closes curl#16153
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