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

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

Closed
wants to merge 1 commit into from

Conversation

vszakats
Copy link
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
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