-
Notifications
You must be signed in to change notification settings - Fork 803
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 targets broken in 8.1.0 when using external nlohmann_json #2762
Comments
@mwtoews opinions / guidance welcome how to fix that. I'd say that external nlohmann_json should not be exported by PROJ cmake files, as it is only an implementation detail that users of the PROJ API don't have direct access to |
@dirkvdb could you provide a few more details, such as the command or options you used to configure cmake? An os and compiler would be handy too. I'm unable to trigger this error, so any guidance will help me find a resolution. |
This happens when configuring proj with -DNLOHMANN_JSON_ORIGIN="external" on any platform.
will get the error. I made a pull request #2763 with a possible fix. |
I'm still unable to trigger this error. Here is my method, first starting up docker in the git repo:
then within the VM:
and I've modified line 7 on Ideally dependant projects won't need |
In the testappprojinfo project you link against proj using the The cmake targets system is superior to using the _LIBRARIES and _INCLUDES variables because it contains more information than just include paths and libraries (linker flags, transitive dependencies, ...) It does require the targets to be found in the cmake config file even when it is a private dependency. This is crucial for static builds that require the transitive dependencies for linking. |
Ah right, it's a static build. I now see the error with |
When cmake configure finds an external nlohmann_json it will use that.
In that case a nlohmann_json::nlohmann_json dependency is set on the cmake targets. But no
find_dependency(nlohmann_json REQUIRED)
is added to the proj-config.cmake.Adding the proj target as a dependency now causes a cmake error:
Environment Information
Installation method
The text was updated successfully, but these errors were encountered: