File tree 9 files changed +20
-14
lines changed
DemoGafferExtensionUITest
9 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1
1
.idea
2
2
.build
3
3
cmake-build- *
4
+ build /
5
+ build.sh
Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ set_target_properties( DemoGafferExtensionModule PROPERTIES PREFIX "" OUTPUT_NAM
24
24
target_compile_definitions ( DemoGafferExtensionModule PRIVATE BOOST_SIGNALS_NO_DEPRECATION_WARNING=1 -D_GLIBCXX_USE_CXX11_ABI=0 )
25
25
target_link_libraries ( DemoGafferExtensionModule DemoGafferExtension )
26
26
27
+ string (REPLACE "." "" PYTHON_VERSION_STRIPPED ${PYTHON_VERSION} )
28
+ string (REPLACE "3.7" "3.7m" PYTHON_FOLDER ${PYTHON_VERSION} )
27
29
if (APPLE )
28
- target_include_directories ( DemoGafferExtensionModule PRIVATE include ${GAFFER_ROOT} /include ${GAFFER_ROOT} /lib/Python.framework /Versions/2.7 /include /python2.7 )
30
+ target_include_directories ( DemoGafferExtensionModule PRIVATE include ${GAFFER_ROOT} /include ${GAFFER_ROOT} /lib/Python.framework /Versions/${PYTHON_VERSION} /include /python ${PYTHON_VERSION} )
29
31
target_link_libraries ( DemoGafferExtensionModule GafferBindings IECorePython boost_python Python)
30
32
else ()
31
- target_include_directories ( DemoGafferExtensionModule PRIVATE include ${GAFFER_ROOT} /include ${GAFFER_ROOT} /include /python2.7 )
32
- target_link_libraries ( DemoGafferExtensionModule GafferBindings IECorePython boost_python27 python2.7 )
33
+ target_include_directories ( DemoGafferExtensionModule PRIVATE include ${GAFFER_ROOT} /include ${GAFFER_ROOT} /include /python ${PYTHON_FOLDER} )
34
+ target_link_libraries ( DemoGafferExtensionModule GafferBindings IECorePython boost_python ${PYTHON_VERSION_STRIPPED} python ${PYTHON_FOLDER} )
33
35
endif (APPLE )
34
36
35
37
install ( TARGETS DemoGafferExtensionModule DESTINATION python/DemoGafferExtension )
@@ -49,3 +51,5 @@ install( DIRECTORY startup DESTINATION . FILES_MATCHING PATTERN "*.py" )
49
51
50
52
# build the extra resources
51
53
install ( DIRECTORY resources DESTINATION . FILES_MATCHING PATTERN "*.gfr" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ )
54
+
55
+
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ setenv DEMO_INSTALL_PREFIX <your extension install path>
23
23
24
24
mkdir gafferExtensionDemo/cmake-build-default
25
25
cd gafferExtensionDemo/cmake-build-default
26
- cmake -DGAFFER_ROOT=$GAFFER_ROOT -DCMAKE_INSTALL_PREFIX=$DEMO_INSTALL_PREFIX ..
26
+ cmake -DGAFFER_ROOT=$GAFFER_ROOT -DCMAKE_INSTALL_PREFIX=$DEMO_INSTALL_PREFIX -DPYTHON_VERSION=2.7 ..
27
27
make install -j <num cores>
28
28
```
29
29
Original file line number Diff line number Diff line change 1
1
__import__ ( "Gaffer" )
2
2
__import__ ( "GafferScene" )
3
3
4
- from _DemoGafferExtension import *
4
+ from . _DemoGafferExtension import *
5
5
6
6
__import__ ( "IECore" ).loadConfig ( "GAFFER_STARTUP_PATHS" , subdirectory = "DemoGafferExtension" )
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ def testAffects( self ) :
47
47
48
48
node ["b" ].setValue ( "test" )
49
49
self .assertEqual ( len ( s ), 5 )
50
- self .failUnless ( s [0 ][0 ].isSame ( node ["b" ] ) )
51
- self .failUnless ( s [1 ][0 ].isSame ( node ["out" ]["childBounds" ] ) )
52
- self .failUnless ( s [2 ][0 ].isSame ( node ["out" ]["bound" ] ) )
53
- self .failUnless ( s [3 ][0 ].isSame ( node ["out" ]["object" ] ) )
54
- self .failUnless ( s [4 ][0 ].isSame ( node ["out" ] ) )
50
+ self .assertTrue ( s [0 ][0 ].isSame ( node ["b" ] ) )
51
+ self .assertTrue ( s [1 ][0 ].isSame ( node ["out" ]["childBounds" ] ) )
52
+ self .assertTrue ( s [2 ][0 ].isSame ( node ["out" ]["bound" ] ) )
53
+ self .assertTrue ( s [3 ][0 ].isSame ( node ["out" ]["object" ] ) )
54
+ self .assertTrue ( s [4 ][0 ].isSame ( node ["out" ] ) )
55
55
56
56
if __name__ == "__main__" :
57
57
unittest .main ()
Original file line number Diff line number Diff line change 1
- from DemoSceneProcessorTest import DemoSceneProcessorTest
1
+ from . DemoSceneProcessorTest import DemoSceneProcessorTest
2
2
3
3
if __name__ == "__main__" :
4
4
import unittest
Original file line number Diff line number Diff line change 3
3
__import__ ( "GafferScene" )
4
4
__import__ ( "GafferSceneUI" )
5
5
6
- import DemoSceneProcessorUI
6
+ from . import DemoSceneProcessorUI
Original file line number Diff line number Diff line change 12
12
13
13
class DocumentationTest ( GafferUITest .TestCase ) :
14
14
15
- def test ( self ) :
15
+ def test ( self ) :
16
16
17
17
self .maxDiff = None
18
18
self .assertNodesAreDocumented (
Original file line number Diff line number Diff line change 1
- from DocumentationTest import DocumentationTest
1
+ from . DocumentationTest import DocumentationTest
2
2
3
3
if __name__ == "__main__" :
4
4
import unittest
You can’t perform that action at this time.
0 commit comments