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: remove external nlohmann_json from INTERFACE_LINK_LIBRARIES target #2780

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

mwtoews
Copy link
Member

@mwtoews mwtoews commented Jul 14, 2021

It seemed that when external nlohmann_json was enabled, the INTERFACE_LINK_LIBRARIES property from the PROJ::proj CMake target included $<LINK_ONLY:nlohmann_json::nlohmann_json>. This causes issues while static linking in downstream projects, and was apparent with some of my contributions to #2686 with projsync and two tests (now removed in this PR). This possible resolution (with the help of this issue discussion) uses $<BUILD_INTERFACE:...>:

Content of ... when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.

This fix has been verified locally with a forthcoming post-install suite that includes static linking.

Closes #2762

@rouault rouault merged commit 23636de into OSGeo:master Jul 14, 2021
github-actions bot pushed a commit that referenced this pull request Jul 14, 2021
CMake: remove external nlohmann_json from INTERFACE_LINK_LIBRARIES target
@mwtoews mwtoews deleted the nlohmann_json_interface_lib branch July 14, 2021 18:01
a0x8o added a commit to a0x8o/PROJ that referenced this pull request Jul 19, 2021
CMake: remove external nlohmann_json from INTERFACE_LINK_LIBRARIES target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake targets broken in 8.1.0 when using external nlohmann_json
2 participants