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: Handle generator expressions requiring a target for pkg-config #1433

Closed
wants to merge 1 commit into from
Closed

Conversation

tambry
Copy link
Contributor

@tambry tambry commented Aug 31, 2020

CMake's find modules may have target-based generator expressions, which get propagated to us when generating the pkg-config file.
CMake 3.19 introduces the TARGET argument to file(GENERATE), which allows resolving such generator expressions and will avoid future issues.
A workaround proposed by @adriaandegroot is added for CMake 3.18.

Additionally changed list->string conversion to use list(JOIN) instead of string replacement.

Fixes #1414.

@facebook-github-bot
Copy link
Contributor

Hi @tambry!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Orvid has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@danobi
Copy link
Contributor

danobi commented Sep 1, 2020

Thanks for the fix. I hit this issue as well.

CMake/GenPkgConfig.cmake Outdated Show resolved Hide resolved
CMake's find modules may have target-based generator expressions, which get propagated to us when generating the pkg-config file.
CMake 3.19 introduces the TARGET argument to file(GENERATE), which allows resolving such generator expressions and will avoid future issues.
A workaround proposed by @adriaandegroot is added for CMake 3.18.

Additionally changed list->string conversion to use list(JOIN) instead of string replacement.

Fixes #1414.
CMakeLists.txt Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Orvid has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@Orvid merged this pull request in eedb340.

facebook-github-bot pushed a commit that referenced this pull request Sep 9, 2020
Summary:
VERSION_GREATER 3.18 also matches 3.18.2, which is wrong as the target argument was only added in 3.19.
After noticing that folly requires an ancient CMake version I converted over from VERSION_GREATER_EQUAL and introduced the comparison error.

Issue reported [here](#1433 (comment)).

Pull Request resolved: #1439

Reviewed By: yfeldblum

Differential Revision: D23564812

Pulled By: Orvid

fbshipit-source-id: 19881876147ec73ad70610cf97c408740f998340
dotconnor pushed a commit to 5448C8/folly that referenced this pull request Mar 19, 2021
…facebook#1433)

Summary:
CMake's find modules may have target-based generator expressions, which get propagated to us when generating the pkg-config file.
CMake 3.19 introduces the TARGET argument to file(GENERATE), which allows resolving such generator expressions and will avoid future issues.
A workaround proposed by adriaandegroot is added for CMake 3.18.

Additionally changed list->string conversion to use list(JOIN) instead of string replacement.

Fixes facebook#1414.

Pull Request resolved: facebook#1433

Reviewed By: yfeldblum

Differential Revision: D23433365

Pulled By: Orvid

fbshipit-source-id: 6ef5f180e13b41f0c92137f53fd8c19ba6355dd6
dotconnor pushed a commit to 5448C8/folly that referenced this pull request Mar 19, 2021
Summary:
VERSION_GREATER 3.18 also matches 3.18.2, which is wrong as the target argument was only added in 3.19.
After noticing that folly requires an ancient CMake version I converted over from VERSION_GREATER_EQUAL and introduced the comparison error.

Issue reported [here](facebook#1433 (comment)).

Pull Request resolved: facebook#1439

Reviewed By: yfeldblum

Differential Revision: D23564812

Pulled By: Orvid

fbshipit-source-id: 19881876147ec73ad70610cf97c408740f998340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$<COMPILE_LANG_AND_ID:lang,id> may only be used with binary targets
5 participants