File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ cmake \
37
37
-DWITH_SERVER=ON \
38
38
-DENABLE_QT5=ON \
39
39
-DENABLE_PYTHON3=ON \
40
+ -DPORT_PLUGINS=ON \
40
41
-DCXX_EXTRA_FLAGS=" $CLANG_WARNINGS " \
41
42
..
Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ MACRO(PY_COMPILE TARGET_NAME RESOURCE_PATHS)
53
53
ENDIF (WITH_PY_COMPILE )
54
54
ENDMACRO (PY_COMPILE )
55
55
56
+ # Macro to auto migrate resources
57
+ MACRO (PY_2TO3 TARGET_NAME RESOURCE_PATHS )
58
+ ADD_CUSTOM_COMMAND (TARGET ${TARGET_NAME}
59
+ POST_BUILD
60
+ COMMAND "${CMAKE_SOURCE_DIR} /scripts/2to3" -w ${RESOURCE_PATHS}
61
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR} "
62
+ COMMENT "Porting to Python 3 and Qt5"
63
+ )
64
+ ENDMACRO (PY_2TO3 )
65
+
56
66
ADD_SUBDIRECTORY (plugins )
57
67
ADD_SUBDIRECTORY (qsci_apis )
58
68
ADD_SUBDIRECTORY (console )
Original file line number Diff line number Diff line change 8
8
9
9
FILE (WRITE ${CMAKE_BINARY_DIR} /stagecount 0 )
10
10
11
+ # The target port-plugins acts as a container for all port-plugin-XXX targets
12
+ # Each port-plugin-XXX target will run scripts/2to3 on a plugin and migrate
13
+ # Python 3 and Qt 5 code.
14
+ ADD_CUSTOM_TARGET (port-plugins )
15
+ SET (PORT_PLUGINS FALSE CACHE BOOL "Determines whether python plugins in staged or installed locations should be migrated to Python 3 and Qt 5" )
16
+ IF (PORT_PLUGINS )
17
+ ADD_CUSTOM_TARGET (port-plugins-on-build ALL DEPENDS port-plugins )
18
+ ENDIF (PORT_PLUGINS )
19
+
11
20
MACRO (PLUGIN_INSTALL plugin subdir )
12
21
FILE (READ ${CMAKE_BINARY_DIR} /stagecount n )
13
22
MATH (EXPR n "${n} +1" )
@@ -24,13 +33,17 @@ MACRO (PLUGIN_INSTALL plugin subdir )
24
33
ADD_DEPENDENCIES (zzz-${plugin}-stageinstall zzz-${plugin}-depend )
25
34
26
35
ADD_CUSTOM_COMMAND (TARGET zzz-${plugin}-stageinstall
27
- COMMAND ${CMAKE_COMMAND} -P ${_cmake}
36
+ COMMAND ${CMAKE_COMMAND} -P ${_cmake}
28
37
)
29
38
30
39
ADD_CUSTOM_TARGET (clean-staged-${plugin}
31
40
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PYTHON_OUTPUT_DIRECTORY} /plugins/${plugin}
32
41
)
33
42
43
+ ADD_CUSTOM_TARGET (port-plugin-${plugin} )
44
+ PY_2TO3 (port-plugin-${plugin} ${PYTHON_OUTPUT_DIRECTORY} /plugins/${plugin} )
45
+ ADD_DEPENDENCIES (port-plugins port-plugin-${plugin} )
46
+
34
47
ADD_DEPENDENCIES (staged-plugins zzz-${plugin}-stageinstall )
35
48
ADD_CUSTOM_TARGET (staged-${plugin} DEPENDS zzz-${plugin}-stageinstall )
36
49
FILE (WRITE ${_cmake} "" )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def test_algorithms(self):
55
55
This is the main test function. All others will be executed based on the definitions in testdata/algorithm_tests.yaml
56
56
"""
57
57
ver = processing .version ()
58
- print "Processing {}.{}.{}" .format (ver / 10000 , ver / 100 % 100 , ver % 100 )
58
+ print ( "Processing {}.{}.{}" .format (ver / 10000 , ver / 100 % 100 , ver % 100 ) )
59
59
with open (os .path .join (processingTestDataPath (), self .test_definition_file ()), 'r' ) as stream :
60
60
algorithm_tests = yaml .load (stream )
61
61
You can’t perform that action at this time.
0 commit comments