Export Target fixes for better transitive properties #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Minor improvements to your PR openscenegraph#63
INSTALL_INTERFACE
. This makes it so that when linking to the target, you get the install directory added transitively correctly.find_dependency
in your new .in file, to search for Qt5 and OSG if they don't already exist. Otherwise targets might not be found properly unless the parent project finds them first with the right components._OSGQOPENGL_ALREADY_DEFINED
block prevents an issue if the same project usesfind_package()
for osgQt more than once in the source tree. This all is needed for OSG and not Qt, because Qt CMakefind_package
defines proper package names (e.g.Qt5::OpenGL
) whereas the OpenSceneGraph CMake package only defines variables. This all helps with correct transitivity when doing a make install, then sharing to another computer, to avoid absolute paths being baked into the link library name.GNUInstallDirs
usage. Without this on Linux your newinstall(TARGETS
will copy the lib files tolib/
instead oflib64/
. There may be other ways to solve this but this seemed most standard. Tested on Windows MSVC and Linux gcc.Although I see the comments on your PR 63, I found this useful and thought I would expand on it based on how we expect to use osgQt.