diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake index b08af1fd2d..7a87ffec6f 100644 --- a/cmake/defaults/Packages.cmake +++ b/cmake/defaults/Packages.cmake @@ -89,11 +89,12 @@ if (PXR_BUILD_IMAGING) find_package(X11) # --PySide find_package(PySide) + # --PyOpenGL + find_package(PyOpenGL) endif() # Third Party Plugin Package Requirements # ---------------------------------------------- - if (PXR_BUILD_KATANA_PLUGIN) find_package(KatanaAPI REQUIRED) find_package(Boost diff --git a/cmake/modules/FindJinja2.cmake b/cmake/modules/FindJinja2.cmake index caf23b203e..820b19af71 100644 --- a/cmake/modules/FindJinja2.cmake +++ b/cmake/modules/FindJinja2.cmake @@ -21,8 +21,6 @@ # KIND, either express or implied. See the Apache License for the specific # language governing permissions and limitations under the Apache License. # -# - Find Modo libraries -# # Jinja2 is a python library, ensure that it is available for use with our # specified version of Python. # @@ -37,6 +35,7 @@ execute_process( jinja2ImportResult ) if (jinja2ImportResult EQUAL 0) + message(STATUS "Found Jinja2") set(JINJA2_FOUND True) endif() diff --git a/cmake/modules/FindPyOpenGL.cmake b/cmake/modules/FindPyOpenGL.cmake new file mode 100644 index 0000000000..2a0f30d480 --- /dev/null +++ b/cmake/modules/FindPyOpenGL.cmake @@ -0,0 +1,41 @@ +# +# Copyright 2016 Pixar +# +# Licensed under the Apache License, Version 2.0 (the "Apache License") +# with the following modification; you may not use this file except in +# compliance with the Apache License and the following modification to it: +# Section 6. Trademarks. is deleted and replaced with: +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor +# and its affiliates, except as required to comply with Section 4(c) of +# the License and to reproduce the content of the NOTICE file. +# +# You may obtain a copy of the Apache License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the Apache License with the above modification is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the Apache License for the specific +# language governing permissions and limitations under the Apache License. +# +# PyOpenGL is a python library, ensure that it is available for use with our +# specified version of Python. +# + +if (NOT PYTHON_EXECUTABLE) + return() +endif() + +execute_process( + COMMAND + "${PYTHON_EXECUTABLE}" "-c" "from OpenGL import *" + RESULT_VARIABLE + pyopenglImportResult +) +if (pyopenglImportResult EQUAL 0) + message(STATUS "Found PyOpenGL") + set(PYOPENGL_FOUND True) +endif() diff --git a/pxr/usd/lib/usd/CMakeLists.txt b/pxr/usd/lib/usd/CMakeLists.txt index 920cc0c97a..9673427e5b 100644 --- a/pxr/usd/lib/usd/CMakeLists.txt +++ b/pxr/usd/lib/usd/CMakeLists.txt @@ -113,6 +113,10 @@ pxr_shared_library(usd generatedSchema.usda ) -pxr_python_bins( - usdGenSchema -) +if (NOT JINJA2_FOUND) + message(WARNING "Skipping building usdGenSchema due to missing dependency: Jinja2") +else() + pxr_python_bins( + usdGenSchema + ) +endif() diff --git a/pxr/usdImaging/lib/usdviewq/CMakeLists.txt b/pxr/usdImaging/lib/usdviewq/CMakeLists.txt index c2ac8e1eb8..a598b41dc7 100644 --- a/pxr/usdImaging/lib/usdviewq/CMakeLists.txt +++ b/pxr/usdImaging/lib/usdviewq/CMakeLists.txt @@ -4,6 +4,9 @@ set(PXR_PACKAGE usdviewq) if (NOT PYSIDE_FOUND) message(WARNING "Not building ${PXR_PACKAGE} because of missing dependency: PySide") return() +elseif(NOT PYOPENGL_FOUND) + message(WARNING "Not building ${PXR_PACKAGE} because of missing dependency: PyOpenGL") + return() endif() pxr_shared_library(usdviewq