Closed pxmkuruc closed 7 years ago
From looking at the code here's what I can gather:
cmake_pip: calls cmake from setup.py
pros:
python setup.py install
interface, which makes it compatible with pipcons:
setup_requires
option to install dependencies required for setup, but google is showing that it may not be as easy to use as it seems. we can always embed cmake_pip into usdQt if that becomes a problem.bloerg.net calls setup.py from cmake (basically uses setup.py to install files in a standard fashion)
pros:
cons:
On paper, I prefer cmake-pip. To get started I think we should just get working cmake files committed, then we can easily experiment with both of these approaches at a later date.
Got it. Let me look at getting cmake-pip installed.
If you're pressed for time, I think the cmake-pip stuff can wait till later, after the cmake build is working. Up to you.
Success! I got the extension built and importing using both setup.py and cmake (I fell back to cmake as a sanity check when I started running into problems). I had to fix a few issues:
PXR_NAMESPACE_OPEN/CLOSE_SCOPE
in all non-wrap*.cpp filesPXR_NAMESSPACE_USING_DIRECTIVE
in wrap*.cpp filesdiff --git a/usdQt/debugCodes.cpp b/usdQt/debugCodes.cpp
index e14b6e7..73b4889 100644
--- a/usdQt/debugCodes.cpp
+++ b/usdQt/debugCodes.cpp
@@ -24,6 +24,8 @@
#include "debugCodes.h"
+PXR_NAMESPACE_OPEN_SCOPE
+
TF_REGISTRY_FUNCTION(TfDebug) {
TF_DEBUG_ENVIRONMENT_SYMBOL(
USDQT_DEBUG_HIERARCHYCACHE,
@@ -37,3 +39,5 @@ TF_REGISTRY_FUNCTION(TfDebug) {
TF_DEBUG_ENVIRONMENT_SYMBOL(USDQT_DEBUG_UNDOSTACK,
"Enabling Undo Stack debugging.");
}
+
+PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/usdQt/debugCodes.h b/usdQt/debugCodes.h
index cda063e..38a7116 100644
--- a/usdQt/debugCodes.h
+++ b/usdQt/debugCodes.h
@@ -27,7 +27,11 @@
#include "pxr/base/tf/debug.h"
+PXR_NAMESPACE_OPEN_SCOPE
+
TF_DEBUG_CODES(USDQT_DEBUG_HIERARCHYCACHE, USDQT_DEBUG_PRIMFILTERCACHE,
USDQT_DEBUG_UNDOSTATEDELEGATE, USDQT_DEBUG_UNDOSTACK);
+PXR_NAMESPACE_CLOSE_SCOPE
+
#endif
diff --git a/usdQt/hierarchyCache.cpp b/usdQt/hierarchyCache.cpp
index 9505a6c..9376be5 100644
--- a/usdQt/hierarchyCache.cpp
+++ b/usdQt/hierarchyCache.cpp
@@ -28,6 +28,8 @@
#include "debugCodes.h"
#include "hierarchyCache.h"
+PXR_NAMESPACE_OPEN_SCOPE
+
typedef TfWeakPtr<UsdQt_HierarchyCache::Proxy> ProxyPtr;
typedef TfRefPtr<UsdQt_HierarchyCache::Proxy> ProxyRefPtr;
@@ -239,4 +241,6 @@ void UsdQt_HierarchyCache::DebugFullIndex() {
<< " [child count]: " << it.second->_GetChildren().size()
<< std::endl;
}
-}
\ No newline at end of file
+}
+
+PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/usdQt/hierarchyCache.h b/usdQt/hierarchyCache.h
index c969fc7..46fffe2 100644
--- a/usdQt/hierarchyCache.h
+++ b/usdQt/hierarchyCache.h
@@ -37,6 +37,8 @@
#include "pxr/usd/usd/primFlags.h"
#include "pxr/usd/usd/stage.h"
+PXR_NAMESPACE_OPEN_SCOPE
+
/// \class UsdQt_HierarchyCache
///
/// The HierarchyCache is an internal class to UsdQt and provides a mapping
@@ -129,4 +131,6 @@ public:
void DebugFullIndex();
};
+PXR_NAMESPACE_CLOSE_SCOPE
+
#endif
diff --git a/usdQt/primFilterCache.cpp b/usdQt/primFilterCache.cpp
index fcac0c1..0afe9a8 100644
--- a/usdQt/primFilterCache.cpp
+++ b/usdQt/primFilterCache.cpp
@@ -22,6 +22,7 @@
// language governing permissions and limitations under the Apache License.
//
+#include "debugCodes.h"
#include "primFilterCache.h"
#include "pxr/base/tf/enum.h"
@@ -30,6 +31,8 @@
#include "pxr/base/work/loops.h"
#include "tbb/parallel_reduce.h"
+PXR_NAMESPACE_OPEN_SCOPE
+
TF_REGISTRY_FUNCTION(TfEnum) {
TF_ADD_ENUM_NAME(UsdQtPrimFilterCache::Accept);
TF_ADD_ENUM_NAME(UsdQtPrimFilterCache::Intermediate);
@@ -167,4 +170,6 @@ UsdQtPrimFilterCache::State UsdQtPrimFilterPathContains::operator()(
if (not prim.GetChildren().empty())
return UsdQtPrimFilterCache::Intermediate;
return UsdQtPrimFilterCache::Reject;
-}
\ No newline at end of file
+}
+
+PXR_NAMESPACE_CLOSE_SCOPE
\ No newline at end of file
diff --git a/usdQt/primFilterCache.h b/usdQt/primFilterCache.h
index b1b9e06..511ce93 100644
--- a/usdQt/primFilterCache.h
+++ b/usdQt/primFilterCache.h
@@ -35,7 +35,7 @@
#include "tbb/concurrent_unordered_map.h"
-#include "debug.h"
+PXR_NAMESPACE_OPEN_SCOPE
/// \class UsdQtPrimFilterCache
///
@@ -123,4 +123,6 @@ public:
UsdQtPrimFilterCache::State operator()(const UsdPrim& prim);
};
+PXR_NAMESPACE_CLOSE_SCOPE
+
#endif
\ No newline at end of file
diff --git a/usdQt/wrapHierarchyCache.cpp b/usdQt/wrapHierarchyCache.cpp
index aa8c694..7e768d7 100644
--- a/usdQt/wrapHierarchyCache.cpp
+++ b/usdQt/wrapHierarchyCache.cpp
@@ -31,6 +31,8 @@
using namespace boost::python;
+PXR_NAMESPACE_USING_DIRECTIVE
+
void wrapHierarchyCache() {
{
typedef UsdQt_HierarchyCache This;
diff --git a/usdQt/wrapPrimFilterCache.cpp b/usdQt/wrapPrimFilterCache.cpp
index 7ae05c9..106037f 100644
--- a/usdQt/wrapPrimFilterCache.cpp
+++ b/usdQt/wrapPrimFilterCache.cpp
@@ -39,6 +39,8 @@
using namespace boost::python;
+PXR_NAMESPACE_USING_DIRECTIVE
+
void wrapPrimFilterCache() {
{
typedef UsdQtPrimFilterCache This;
Looks like all the notes have been resolved. I had one more question, then I want to make sure I can compile this on my end, then we'll merge it and move on to the next batch.
Looks great!
Do you have a strong preference for approach? We don't have cmake_pip internally.