Skip to content

Commit

Permalink
Link to the OpenGL::GL target, instead of ${OPENGL_LIBRARIES}
Browse files Browse the repository at this point in the history
This is better because:

- targets are the modern way, and generally preferred
- provides an opportunity to inherit other properties of the target
- prevents absolute paths from creeping into the output
  MaterialXConfig.cmake, which makes it less portable
- ${OPENGL_LIBRARIES} includes libGLU (at least on linux), which is not
  actually a required dependency
  • Loading branch information
pmolodo committed Nov 23, 2023
1 parent a0b9cd0 commit b1648f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/MaterialXRenderGlsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ if(WIN32)
elseif(APPLE)
target_link_libraries(
${MATERIALX_MODULE_NAME}
${OPENGL_LIBRARIES}
OpenGL::GL
"-framework Foundation"
"-framework Cocoa"
"-framework Metal")
elseif(UNIX)
target_link_libraries(
${MATERIALX_MODULE_NAME}
${OPENGL_LIBRARIES}
OpenGL::GL
${X11_LIBRARIES}
${X11_Xt_LIB})
endif()
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXRenderMsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ elseif(APPLE)
target_link_libraries(
${MATERIALX_MODULE_NAME}
"-framework Cocoa"
${OPENGL_LIBRARIES}
OpenGL::GL
)
endif()
target_link_libraries(
Expand All @@ -67,7 +67,7 @@ elseif(APPLE)
elseif(UNIX)
target_link_libraries(
${MATERIALX_MODULE_NAME}
${OPENGL_LIBRARIES}
OpenGL::GL
${X11_LIBRARIES}
${X11_Xt_LIB})
endif()
Expand Down

0 comments on commit b1648f1

Please sign in to comment.