From bf8e8f45f675e740fe793227c22d554113ea7232 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 4 May 2017 23:41:22 +0200 Subject: 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) --- CMakeScripts/InstallMSYS2.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CMakeScripts/InstallMSYS2.cmake') 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^/var/cache/fontconfig^") # the '^' are needed to escape angle brackets on Windows command shell + set(cachedir_appdata "\\t^LOCAL_APPDATA_FONTCONFIG_CACHE^") + 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 -- cgit v1.2.3