commit f7928375314d8a6ae31aea64b847eb75d734c5f9
Author: Kornel Benko <[email protected]>
Date: Fri Jun 10 13:38:29 2016 +0200
Cmake build: Finetune some destination data paths on UNIX
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0f1bac..fee89e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -430,7 +430,13 @@ if(LYX_INSTALL_PREFIX)
endif()
set(LYX_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice
install prefix" FORCE)
-string(REGEX REPLACE "/lyx${LYX_INSTALL_SUFFIX}$" "/share" SYSTEM_DATADIR
${CMAKE_INSTALL_PREFIX})
+if(UNIX)
+ set(SYSTEM_DATADIR "${CMAKE_INSTALL_PREFIX}/share")
+elseif(CMAKE_INSTALL_PREFIX MATCHES "/lyx${LYX_INSTALL_SUFFIX}$")
+ string(REGEX REPLACE "/lyx${LYX_INSTALL_SUFFIX}$" "/share" SYSTEM_DATADIR
${CMAKE_INSTALL_PREFIX})
+else()
+ set(SYSTEM_DATADIR "${CMAKE_INSTALL_PREFIX}")
+endif()
if(LYX_PACKAGE_SUFFIX)
set(PACKAGE ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake
index 7ee5dde..8ed041f 100755
--- a/development/cmake/Install.cmake
+++ b/development/cmake/Install.cmake
@@ -12,11 +12,11 @@ endif()
#
# Special handling for ${_file_type} == "*"
# Here we try to exclude files which we do not want to install
-# Depending on _what, installation goes to
+# Depending on _what, installation on UNIX goes to
# data -> ${LYX_DATA_SUBDIR}
-# font -> fonts/truetype/${_lyx}/
+# font -> share/fonts/truetype/${_lyx}/
# bin -> bin
-# tex -> texmf/tex/latex/${_lyx}/
+# tex -> share/texmf/tex/latex/${_lyx}/
macro(lyx_install _what _parent_src_dir _gl_dir _file_type)
#message("checking parents ${_parent_src_dir}")
file(GLOB _dirs RELATIVE "${_parent_src_dir}" ${_parent_src_dir}/${_gl_dir})
diff --git a/development/cmake/modules/LyXDestinations.cmake
b/development/cmake/modules/LyXDestinations.cmake
index 6bb17c4..d003e91 100644
--- a/development/cmake/modules/LyXDestinations.cmake
+++ b/development/cmake/modules/LyXDestinations.cmake
@@ -67,7 +67,8 @@ function(get_font_destination _result)
# "Contents/Resources/fonts/"
set(_dir "${LYX_DATA_SUBDIR}fonts/")
elseif(UNIX)
- set(_dir "fonts/truetype/${_lyx}/")
+ # at least on ubuntu
+ set(_dir "share/fonts/truetype/${_lyx}/")
else()
message(FATAL_ERROR "Unhandled platform")
endif()
@@ -82,7 +83,7 @@ function(get_tex_destination _result)
# "Contents/Resources/tex/"
set(_dir "${LYX_DATA_SUBDIR}tex/")
elseif(UNIX)
- set(_dir "texmf/tex/latex/${_lyx}/")
+ set(_dir "share/texmf/tex/latex/${_lyx}/")
else()
message(FATAL_ERROR "Unhandled platform")
endif()