summaryrefslogtreecommitdiffstats
path: root/CMakeScripts
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-09-23 19:23:17 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-09-23 19:23:17 +0000
commita0d689ccda0448d1c4cc4aa0e777aeeb9826c3c2 (patch)
treed992bca5f4d2b453c2de8ac0d30c1bef3eaaf56f /CMakeScripts
parentfix tooggled value and po glade fila added (diff)
downloadinkscape-a0d689ccda0448d1c4cc4aa0e777aeeb9826c3c2.tar.gz
inkscape-a0d689ccda0448d1c4cc4aa0e777aeeb9826c3c2.zip
CMake/MSYS2: Pre-compile python byte-code (.pyc files)
See https://gitlab.com/inkscape/inkscape/issues/299
Diffstat (limited to 'CMakeScripts')
-rw-r--r--CMakeScripts/InstallMSYS2.cmake15
1 files changed, 11 insertions, 4 deletions
diff --git a/CMakeScripts/InstallMSYS2.cmake b/CMakeScripts/InstallMSYS2.cmake
index 4466a85a0..3be5bdbd2 100644
--- a/CMakeScripts/InstallMSYS2.cmake
+++ b/CMakeScripts/InstallMSYS2.cmake
@@ -173,7 +173,7 @@ if(WIN32)
# adjust fonts.conf
# - add "%localappdata%\Microsoft\Windows\Fonts" as font dir
# which is the default path for fonts installed per-user in Windows 10 (version 1809)
- # - store font cache in non-temporary directory in "%localappdata%\fontconfig\cache"
+ # - store font cache in non-temporary directory in "%localappdata%\fontconfig\cache"
set(fontdir_default "\\t^<dir^>WINDOWSFONTDIR^</dir^>") # the '^' are needed to escape angle brackets on Windows command shell
set(fontdir_additional "\\t^<dir^>~/AppData/Local/Microsoft/Windows/Fonts^</dir^>")
set(cachedir_default "\\t^<cachedir^>/var/cache/fontconfig^</cachedir^>")
@@ -206,7 +206,7 @@ if(WIN32)
# Typelibs for gtk, pango, cairo -> can be used in Python extensions
# ToDo: Automate the creation of this collection!
- install (FILES
+ install (FILES
${MINGW_LIB}/girepository-1.0/Atk-1.0.typelib
${MINGW_LIB}/girepository-1.0/cairo-1.0.typelib
${MINGW_LIB}/girepository-1.0/Gdk-3.0.typelib
@@ -265,6 +265,7 @@ if(WIN32)
DESTINATION lib
PATTERN "python3.7/site-packages" EXCLUDE # specify individual packages to install below
PATTERN "python3.7/test" EXCLUDE # we don't need the Python testsuite
+ PATTERN "*.pyc" EXCLUDE
)
set(site_packages "lib/python3.7/site-packages")
@@ -275,6 +276,7 @@ if(WIN32)
install_list(FILES ${paths}
ROOT ${MINGW_PATH}
INCLUDE ${site_packages} # only include content from "site-packages" (we might consider to install everything)
+ EXCLUDE ".pyc$"
)
endforeach()
# Python packages installed via pip
@@ -285,9 +287,13 @@ if(WIN32)
ROOT ${MINGW_PATH}/${site_packages}
DESTINATION ${site_packages}/
EXCLUDE "^\\.\\.\\/" # exclude content in parent directories (notably scripts installed to /bin)
+ EXCLUDE ".pyc$"
)
endforeach()
-
+ install(CODE
+ "MESSAGE(\"Pre-compiling Python byte-code (.pyc files)\")
+ execute_process(COMMAND \${CMAKE_INSTALL_PREFIX}/bin/python -m compileall -qq \${CMAKE_INSTALL_PREFIX})")
+
# gdb
install(FILES
${MINGW_BIN}/gdb.exe
@@ -295,7 +301,8 @@ if(WIN32)
DESTINATION bin)
install(DIRECTORY
${MINGW_PATH}/share/gdb
- DESTINATION share)
+ DESTINATION share
+ PATTERN "*.pyc" EXCLUDE)
install(FILES
packaging/win32/gdb_create_backtrace.bat
DESTINATION bin)