File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ IF (WITH_BINDINGS)
76
76
# as otherwise user has to use PYTHONPATH environemnt variable to add
77
77
# QGIS bindings to package search path
78
78
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)" )
79
+ SET (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations are byte-compiled" )
79
80
# concatenate QScintilla2 API files
80
81
SET (WITH_QSCIAPI TRUE CACHE BOOL "Determines whether the QScintilla2 API files will be updated and concatenated" )
81
82
ENDIF (WITH_BINDINGS )
@@ -640,6 +641,10 @@ ENDIF (UNIX AND NOT APPLE)
640
641
641
642
INSTALL (FILES cmake/FindQGIS.cmake DESTINATION ${QGIS_DATA_DIR} )
642
643
644
+ #############################################################
645
+ # Post-install commands
646
+ ADD_SUBDIRECTORY (postinstall )
647
+
643
648
#############################################################
644
649
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
645
650
CONFIGURE_FILE (
Original file line number Diff line number Diff line change
1
+
2
+ # for included scripts that set policies
3
+ INSTALL (CODE "cmake_policy(SET CMP0011 NEW)" )
4
+
5
+ CONFIGURE_FILE ("PostInstall.cmake.in" "PostInstall.cmake" @ONLY )
6
+ INSTALL (SCRIPT "${CMAKE_BINARY_DIR} /postinstall/PostInstall.cmake" )
Original file line number Diff line number Diff line change
1
+
2
+ # kill boolean warnings
3
+ CMAKE_POLICY (SET CMP0012 NEW )
4
+
5
+ IF (@WITH_PY_COMPILE@ )
6
+ MESSAGE (STATUS "Byte-compiling core Python utilities and plugins..." )
7
+ # exclude Python 3 modules in PyQt4.uic package
8
+ EXECUTE_PROCESS (COMMAND @PYTHON_EXECUTABLE@ -m compileall -q -x ".*uic.port_v3.*" "@CMAKE_INSTALL_PREFIX@/@QGIS_DATA_DIR@/python" )
9
+ ENDIF (@WITH_PY_COMPILE@ )
Original file line number Diff line number Diff line change @@ -167,3 +167,13 @@ INSTALL(FILES ${PY_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PYTHON_DIR}")
167
167
168
168
ADD_SUBDIRECTORY (console_help )
169
169
170
+ # Byte-compile staged PyQGIS utilities
171
+ IF (WITH_PY_COMPILE )
172
+ ADD_CUSTOM_TARGET (pycompile_pyutils ALL
173
+ COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY} /qgis"
174
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR} "
175
+ COMMENT "Byte-compiling staged PyQGIS utility modules..."
176
+ DEPENDS pyutils
177
+ )
178
+ ENDIF (WITH_PY_COMPILE )
179
+
Original file line number Diff line number Diff line change
1
+ IF (WITH_PY_COMPILE )
2
+ ADD_CUSTOM_TARGET (pycompile_staged ALL
3
+ COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY} /plugins"
4
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR} "
5
+ COMMENT "Byte-compiling staged Python plugins..."
6
+ )
7
+ ENDIF (WITH_PY_COMPILE )
1
8
2
9
MACRO (PLUGIN_INSTALL plugin subdir )
3
10
INSTALL (FILES ${ARGN} DESTINATION ${QGIS_DATA_DIR} /python/plugins/${plugin}/${subdir} )
4
11
STRING (REPLACE "/" "_" subdir_sane "${subdir} " )
5
12
ADD_CUSTOM_TARGET (${plugin} _${subdir_sane}_stageinstall ALL DEPENDS ${ARGN} )
13
+ IF (WITH_PY_COMPILE )
14
+ ADD_DEPENDENCIES (pycompile_staged ${plugin} _${subdir_sane}_stageinstall )
15
+ ENDIF (WITH_PY_COMPILE )
6
16
FOREACH (file ${ARGN} )
7
17
ADD_CUSTOM_COMMAND (TARGET ${plugin} _${subdir_sane}_stageinstall
8
18
POST_BUILD
You can’t perform that action at this time.
0 commit comments