[LyX/master] Cmake build: Install lyx fonts in system dir too on linux

Kornel Benko kornel at lyx.org
Sun Aug 30 18:08:52 UTC 2020


commit 46fca4dc1d3298bfbfa41c1ad2233116d176610e
Author: Kornel Benko <kornel at lyx.org>
Date:   Sun Aug 30 20:30:21 2020 +0200

    Cmake build: Install lyx fonts in system dir too on linux
    
    1.) Math-editor seems to use system fonts, so install it there.
    2.) We use fonts from the support-dir, so install them there too.
    
    This is something automake may take int account too.
---
 development/cmake/Install.cmake                 |    9 ++++++---
 development/cmake/modules/LyXDestinations.cmake |    4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake
index bdeea93..befe556 100755
--- a/development/cmake/Install.cmake
+++ b/development/cmake/Install.cmake
@@ -24,7 +24,8 @@ macro(lyx_install _what _parent_src_dir _gl_dir _file_type)
   if(NOT _dirs)
     set(_dirs .)
   endif()
-  # Select installation dir
+  # Select installation dir(s)
+  # Mark, that _dest_subdir may be a list
   if ("${_what}" STREQUAL "data")
     get_data_destination(_dest_subdir)
   elseif ("${_what}" STREQUAL "font")
@@ -78,8 +79,10 @@ macro(lyx_install _what _parent_src_dir _gl_dir _file_type)
             set(_base_dir .)
           endif()
 
-          install(FILES ${files_list} DESTINATION "${_dest_subdir}${_dir}/${_base_dir}")
-          #message(STATUS "Installing  ${files_list} to ${_dest_subdir}${_dir}/${_base_dir}")
+	  foreach(_dst ${_dest_subdir})
+	    install(FILES ${files_list} DESTINATION "${_dst}${_dir}/${_base_dir}")
+	    #message(STATUS "Installing  ${files_list} to ${_dest_subdir}${_dir}/${_base_dir}")
+	  endforeach()
         endif()
         if(program_list)
           if(_glob_dir STREQUAL ".")
diff --git a/development/cmake/modules/LyXDestinations.cmake b/development/cmake/modules/LyXDestinations.cmake
index b202271..87de7a9 100644
--- a/development/cmake/modules/LyXDestinations.cmake
+++ b/development/cmake/modules/LyXDestinations.cmake
@@ -68,7 +68,9 @@ function(get_font_destination _result)
     set(_dir "${LYX_DATA_SUBDIR}fonts/")
   elseif(UNIX)
     # at least on ubuntu
-    set(_dir "${LYX_DATA_SUBDIR}fonts/")
+    # ${LYX_DATA_SUBDIR}: Satisfy lyx because GuiFontLoader.cpp searches there
+    # share/fonts: because math-editor uses system font
+    set(_dir "${LYX_DATA_SUBDIR}fonts/" "share/fonts/${_lyx}/")
   else()
     message(FATAL_ERROR "Unhandled platform")
   endif()


More information about the lyx-cvs mailing list