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

Link to X11 targets instead of CMake variables #1606

Merged

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Nov 27, 2023

NOTE: please review / merge #1603 before this, as this PR depends on it

(If it is determined that #1603 is unacceptable for some reason, in a way that does NOT apply to this PR, I can rebase / refactor this MR to not rely on #1603)


ie, ${X11_LIBRARIES} and ${X11_Xt_LIB}

This prevents absolute paths from creeping into the output
MaterialXConfig.cmake, which makes it not portable.

Also, in general in modern CMake, targets are preferred over baked
paths.

The point of COMMON_LIBRARIES was apparently to allow all library
linking to be done with a single command; however, continuing this
paradigm becomes difficult as more complex conditions are built up -
for instance, in MaterialXRenderMsl/CMakeLists.txt, we were altering
COMMON_LIBRARIES if APPLE and NOT iOS... which, at best, made the name
COMMON_LIBRARIES unclear.

Refactored to simply make multiple calls to target_link_libraries, which
is the way most other CMakeLists.txt in this repo handle this.
This prevents absolute paths from creeping into the output
MaterialXConfig.cmake, which makes it not portable.

Also, in general in modern CMake, targets are preferred over baked
paths.  Plus, at least on Linux, ${OPENGL_LIBRARIES} includes libGLU,
which is not actually a required dependency
ie, ${X11_LIBRARIES} and ${X11_Xt_LIB}

This prevents absolute paths from creeping into the output
MaterialXConfig.cmake, which makes it not portable.

Also, in general in modern CMake, targets are preferred over baked
paths.
@jstone-lucasfilm jstone-lucasfilm changed the title Link to the X11::X11 and X11::Xt targets instead of cmake variables Link to X11 targets instead of CMake variables Nov 29, 2023
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good as well, thanks @pmolodo!

@jstone-lucasfilm jstone-lucasfilm merged commit b8cc4de into AcademySoftwareFoundation:main Nov 29, 2023
30 checks passed
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