Skip to content

Export Target fixes for better transitive properties #1

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

emminizer
Copy link

@emminizer emminizer commented May 19, 2025

Minor improvements to your PR openscenegraph#63

  • Include directory now set on library target for INSTALL_INTERFACE. This makes it so that when linking to the target, you get the install directory added transitively correctly.
  • Now using 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.
  • Fixed transitivity of link libraries and include directories for OSG. The _OSGQOPENGL_ALREADY_DEFINED block prevents an issue if the same project uses find_package() for osgQt more than once in the source tree. This all is needed for OSG and not Qt, because Qt CMake find_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.
  • Added GNUInstallDirs usage. Without this on Linux your new install(TARGETS will copy the lib files to lib/ instead of lib64/. 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.

emminizer added 2 commits May 19, 2025 10:13
…correctly set; Qt5 and OSG are now correctly searched for if needed; link libraries and include path are now set transitively based on current system's OSG libraries, improving portability of install.
@yanzixiang yanzixiang merged commit 3666058 into yanzixiang:cmake-target May 20, 2025
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.

2 participants