PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.98k stars 1.18k forks source link

USD bakes full SDK path to INTERFACE_LINK_LIBRARIES in pxrTargets.cmake #2771

Open dgovil opened 10 months ago

dgovil commented 10 months ago

pxrTargets.cmake bakes in the full path to an SDK library during the build which means that the final build isn't portable to build other stuff against unless all the machines have the same SDK versions available.

Unfortunately that means that if someone upgrades their OS, they won't have the same SDK versions available, and will therefore be unable to compile without modifying the targets file.

It would be great if USD used generic linkage for system libs instead of exact SDK versions

e.g

set_target_properties(arch PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "/Library/Developer/CommandLineTools/SDKs/MacOSX13.5.sdk/usr/lib/libm.tbd"
)
set_target_properties(garch PROPERTIES
  INTERFACE_LINK_LIBRARIES "arch;tf;/Library/Developer/CommandLineTools/SDKs/MacOSX13.5.sdk/System/Library/Frameworks/OpenGL.framework;/Library/Developer/CommandLineTools/SDKs/MacOSX13.5.sdk/System/Library/Frameworks/AppKit.framework"

)
jesschimein commented 10 months ago

Filed as internal issue #USD-8891

dgovil commented 10 months ago

Put up a PR for this