summarylogtreecommitdiffstats
path: root/boost_python2.patch
blob: 82692cf287427f1f523c04e2bddb616ada68b53c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index 9be215b36..031c64ab0 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -43,12 +43,16 @@ if(PXR_ENABLE_PYTHON_SUPPORT)
     find_package(PythonLibs 2.7 REQUIRED)
 
     # --Boost
+    # replace 'python' with 'python27' as boost>=1.67 require python version suffix
+    # https://cmake.org/cmake/help/v3.15/module/FindBoost.html
     find_package(Boost
         COMPONENTS
             program_options
-            python
+            python27
         REQUIRED
     )
+    # fix rest of code expecting 'Boost_PYTHON_LIBRARY'
+    set(Boost_PYTHON_LIBRARY "${Boost_PYTHON27_LIBRARY}")
 
     # --Jinja2
     find_package(Jinja2)
diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake
index 32274b3f4..d6ee46b51 100644
--- a/cmake/macros/Private.cmake
+++ b/cmake/macros/Private.cmake
@@ -120,7 +120,7 @@ function(_install_python LIBRARY_NAME)
         ${ARGN}
     )
 
-    set(libPythonPrefix lib/python)
+    set(libPythonPrefix lib/python2.7/site-packages)
     _get_python_module_name(${LIBRARY_NAME} LIBRARY_INSTALLNAME)
 
     set(files_copied "")
@@ -268,7 +268,7 @@ function(_install_pyside_ui_files LIBRARY_NAME)
             FOLDER "${folder}"
     )
 
-    set(libPythonPrefix lib/python)
+    set(libPythonPrefix lib/python2.7/site-packages)
     _get_python_module_name(${LIBRARY_NAME} LIBRARY_INSTALLNAME)
 
     install(
@@ -947,7 +947,7 @@ function(_pxr_python_module NAME)
     # 'from pxr import X'. Additionally, python libraries always install
     # into the default lib install, not into the third_party subdirectory
     # or similar.
-    set(libInstallPrefix "lib/python/pxr/${pyModuleName}")
+    set(libInstallPrefix "lib/python2.7/site-packages/pxr/${pyModuleName}")
 
     # Python modules need to be able to access their corresponding
     # wrapped library and the install lib directory.
diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake
index ed9ae9a31..f9c023f44 100644
--- a/cmake/macros/Public.cmake
+++ b/cmake/macros/Public.cmake
@@ -350,7 +350,7 @@ function(pxr_setup_python)
     string(REPLACE ";" ", " pyModulesStr "${converted}")
 
     # Install a pxr __init__.py with an appropriate __all__
-    _get_install_dir(lib/python/pxr installPrefix)
+    _get_install_dir(lib/python2.7/site-packages/pxr installPrefix)
 
     file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated_modules_init.py"
          "__all__ = [${pyModulesStr}]\n")
@@ -391,7 +391,7 @@ function (pxr_create_test_module MODULE_NAME)
             RENAME 
                 __init__.py
             DESTINATION 
-                tests/${tm_INSTALL_PREFIX}/lib/python/${MODULE_NAME}
+                tests/${tm_INSTALL_PREFIX}/lib/python2.7/site-packages/pxr/${MODULE_NAME}
         )
     endif()
     if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${plugInfoFile}")
@@ -401,7 +401,7 @@ function (pxr_create_test_module MODULE_NAME)
             RENAME 
                 plugInfo.json
             DESTINATION 
-                tests/${tm_INSTALL_PREFIX}/lib/python/${MODULE_NAME}
+                tests/${tm_INSTALL_PREFIX}/lib/python2.7/site-packages/pxr/${MODULE_NAME}
         )
     endif()
 endfunction() # pxr_create_test_module
@@ -704,7 +704,7 @@ function(pxr_register_test TEST_NAME)
         # Ensure that Python imports the Python files built by this build.
         # On Windows convert backslash to slash and don't change semicolons
         # to colons.
-        set(_testPythonPath "${CMAKE_INSTALL_PREFIX}/lib/python;$ENV{PYTHONPATH}")
+        set(_testPythonPath "${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/pxr;$ENV{PYTHONPATH}")
         if(WIN32)
             string(REGEX REPLACE "\\\\" "/" _testPythonPath "${_testPythonPath}")
         else()
diff --git a/pxr/base/lib/plug/testPlug.py b/pxr/base/lib/plug/testPlug.py
index 377e66632..776a1317a 100644
--- a/pxr/base/lib/plug/testPlug.py
+++ b/pxr/base/lib/plug/testPlug.py
@@ -32,7 +32,7 @@ from pxr import Plug, Tf, Gf
 # Test plugins are installed relative to this script
 testRoot = os.path.join(os.path.dirname(__file__), 'PlugPlugins')
 testPluginsDso = testRoot + '/lib'
-testPluginsPython = testRoot + '/lib/python'
+testPluginsPython = testRoot + '/lib/python2.7/site-packages/pxr'
 testPluginsDsoSearch = testPluginsDso + '/*/Resources/'
 testPluginsPythonSearch = testPluginsPython + '/**/'
 
diff --git a/pxr/usdImaging/lib/usdviewq/CMakeLists.txt b/pxr/usdImaging/lib/usdviewq/CMakeLists.txt
index 66c5b2091..91c878bf3 100644
--- a/pxr/usdImaging/lib/usdviewq/CMakeLists.txt
+++ b/pxr/usdImaging/lib/usdviewq/CMakeLists.txt
@@ -80,7 +80,7 @@ pxr_library(usdviewq
 
 install(DIRECTORY
     icons
-    DESTINATION lib/python/pxr/Usdviewq
+    DESTINATION lib/python2.7/site-packages/pxr/Usdviewq
 )
 
 pxr_test_scripts(