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

pxrTargets.cmake requiring OpenGL when GL support disabled at build #3435

Open
rishflab opened this issue Nov 24, 2024 · 1 comment
Open

Comments

@rishflab
Copy link

rishflab commented Nov 24, 2024

Description of Issue

The pxrTargets.cmake defines OpenGL as a dependency when GL support is disabled when running the build script.

//pxrTargets.cmake
# Create imported target garch
add_library(garch SHARED IMPORTED)

set_target_properties(garch PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "arch;tf;-framework Foundation;-framework AppKit;OpenGL::GL"
)

Removing OpenGL::GL fixes the error

CMake Error at /$HOME/OpenUSDInstall/cmake/pxrTargets.cmake:329 (set_target_properties):
The link interface of target "garch" contains:

OpenGL::GL

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first):
/Users/rishflab/OpenUSDInstall/pxrConfig.cmake:77 (include)
CMakeLists.txt:8 (find_package)


Steps to Reproduce

  1. Build using to disable OpenGL dependency
python OpenUSD/build_scripts/build_usd.py OpenUSDInstall --build-args USD,"DPXR_ENABLE_GL_SUPPORT=FALSE" --no-python

  1. create a project with OpenUSD as a dependency
find_package(pxr REQUIRED PATHS $HOME/OpenUSDInstall)  

target_link_libraries(view METAL_CPP ${PXR_LIBRARIES})

target_include_directories(view PRIVATE ${PXR_INCLUDE_DIRS})
  1. build the project
cmake -D CMAKE_BUILD_TYPE=Debug -S . -B build
cmake --build build --target view

System Information (OS, Hardware)

Mac OS, M3 Max

Package Versions

OpenUSD 24.11

Build Flags

python OpenUSD/build_scripts/build_usd.py OpenUSDInstall --build-args USD,"DPXR_ENABLE_GL_SUPPORT=FALSE" --no-python

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10459

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

No branches or pull requests

2 participants