summaryrefslogtreecommitdiffstats
path: root/CMakeScripts
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-05-04 21:41:22 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-05-04 21:41:22 +0000
commitbf8e8f45f675e740fe793227c22d554113ea7232 (patch)
treefdd7d0eda7e2aeec9c7a77726da728b26576ca42 /CMakeScripts
parentcmake/MSYS2: Exclude python testsuite from install (diff)
downloadinkscape-bf8e8f45f675e740fe793227c22d554113ea7232.tar.gz
inkscape-bf8e8f45f675e740fe793227c22d554113ea7232.zip
cmake/MSYS2: adjust fonts.conf to store fontconfig cache in AppData
MSYS2 uses '/var/cache/fontconfig' by default which is not available outside of the MSYS environment and therefore get's created in the root folder of the Inkscape installation. On most systems this will be in read-only 'Program Files' (which might still work thanks to virtual store, but better be safe then sorry). This also makes sure we do not re-introduce bug #1196373 (bzr r15661)
Diffstat (limited to 'CMakeScripts')
-rw-r--r--CMakeScripts/InstallMSYS2.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeScripts/InstallMSYS2.cmake b/CMakeScripts/InstallMSYS2.cmake
index aac4fd648..c8c580fe4 100644
--- a/CMakeScripts/InstallMSYS2.cmake
+++ b/CMakeScripts/InstallMSYS2.cmake
@@ -166,7 +166,20 @@ if(WIN32)
install(DIRECTORY ${MINGW_PATH}/share/glib-2.0/schemas
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/glib-2.0)
+ # fontconfig
install(DIRECTORY ${MINGW_PATH}/etc/fonts
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/etc
+ FILES_MATCHING PATTERN "fonts.conf" EXCLUDE)
+ # adjust fonts.conf to store font cache in AppData
+ set(cachedir_default "\\t^<cachedir^>/var/cache/fontconfig^</cachedir^>") # the '^' are needed to escape angle brackets on Windows command shell
+ set(cachedir_appdata "\\t^<cachedir^>LOCAL_APPDATA_FONTCONFIG_CACHE^</cachedir^>")
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf
+ COMMAND sed 's!${cachedir_default}!${cachedir_appdata}\\n${cachedir_default}!' ${MINGW_PATH}/etc/fonts/fonts.conf > ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf
+ MAIN_DEPENDENCY ${MINGW_PATH}/etc/fonts/fonts.conf
+ )
+ add_custom_target(fonts_conf ALL DEPENDS ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf)
+ install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/fonts
DESTINATION ${CMAKE_INSTALL_PREFIX}/etc)
# GTK 3.0