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
Add a target to RapidJSONConfig.cmake.in #1350
Conversation
This way, users can call target_link_libraries against the imported target, which is the recommended way of doing things.
Any hope to see this merged? |
Can you explain why this is needed? |
Sure. Modern CMake is moving away from simple variables and towards providing targets. You can find the same trend in most Find*.cmake modules provided by upstream. The reason is that variables are easy to mistype and might silently expand to nothing (target existance is instead checked at the point of usage). You also need more commands to use them, and makes for worse extensibility (you need a variable for includes, one for libraries to link against, one for compile definitions...). Instead with targets, you just link against a target, and all sensible properties are propagated automatically. This makes for less code to maintain and check. See also: |
Please merge something like this before releasing a new version. It's just a new practice in CMake usage. For example, when vcpkg installs "xsimd," after finishes, it prints
Even though xsimd is header-only. But with rapidjson, it prints
Which looks sort of outdated. I kind of prefer the |
Hi there, This would be really really useful indeed. That way projects that use RapidJSON and modern CMake techniques would not need to defined their own Thanks, |
Hi dear @miloyip, thank you for your work! The library is great as it is, but sadly it is missing two important things:
@tchernobog, please add RapidJSON::RapidJSON target. |
This way, users can call target_link_libraries against the imported target, which is the recommended way of doing things.