Skip to content

Commit

Permalink
Add Python version to pxrConfig.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Popravka committed Nov 15, 2022
1 parent 9d21755 commit 3294fc0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,9 @@ def InstallUSD(context, force, buildArgs):
extraArgs.append('-D{prefix}_INCLUDE_DIR="{pyIncPath}"'
.format(prefix=prefix,
pyIncPath=pythonInfo[2]))
extraArgs.append('-D{prefix}_VERSION="{pyVersion}"'
.format(prefix=prefix,
pyVersion=pythonInfo[3]))
else:
extraArgs.append('-DPXR_ENABLE_PYTHON_SUPPORT=OFF')

Expand Down
12 changes: 10 additions & 2 deletions pxr/pxrConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ if(@PXR_ENABLE_PYTHON_SUPPORT@)
set(Python3_INCLUDE_DIR "@Python3_INCLUDE_DIR@")
endif()

find_package(Python3 COMPONENTS Development REQUIRED)
if (NOT "@Python3_VERSION@" STREQUAL "")
find_package(Python3 "@Python3_VERSION@" EXACT COMPONENTS Development REQUIRED)
else()
find_package(Python3 COMPONENTS Development REQUIRED)
endif()
else()
if (NOT DEFINED Python2_EXECUTABLE AND "@Python2_EXECUTABLE@")
set(Python2_EXECUTABLE "@Python2_EXECUTABLE@")
Expand All @@ -49,7 +53,11 @@ if(@PXR_ENABLE_PYTHON_SUPPORT@)
set(Python2_INCLUDE_DIR "@Python2_INCLUDE_DIR@")
endif()

find_package(Python2 COMPONENTS Development REQUIRED)
if (NOT "@Python2_VERSION@" STREQUAL "")
find_package(Python2 "@Python2_VERSION@" EXACT COMPONENTS Development REQUIRED)
else()
find_package(Python2 COMPONENTS Development REQUIRED)
endif()
endif()

endif()
Expand Down

0 comments on commit 3294fc0

Please sign in to comment.