]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/LyXDestinations.cmake
Fix screen display of parts and chapters in default classes
[lyx.git] / development / cmake / modules / LyXDestinations.cmake
1 # This file is part of lyx.
2 #
3 # Helper function to get path to destination directories
4 #
5 # Copyright (c) 2016 Kornel Benko <kornel@lyx.org>
6 #
7 #  Redistribution and use in source and binary forms, with or without
8 #  modification, are permitted provided that the following conditions
9 #  are met:
10 #
11 #  1. Redistributions of source code must retain the copyright
12 #         notice, this list of conditions and the following disclaimer.
13 #  2. Redistributions in binary form must reproduce the copyright
14 #         notice, this list of conditions and the following disclaimer in the
15 #         documentation and/or other materials provided with the distribution.
16 #  3. The name of the author may not be used to endorse or promote products
17 #         derived from this software without specific prior written permission.
18 #
19 # This file is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with lyx; if not, write to the Free Software
26 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 #
28 # LYX_DATA_SUBDIR is defined in ${TOP_SRC_DIR}/CMakeLists.txt
29
30
31 function(get_locale_destination _result)
32   set(_dir)
33   if(WIN32)
34     # "Resources/locale"
35     set(_dir "${LYX_DATA_SUBDIR}locale")
36   elseif(APPLE)
37     # "Contents/Resources/locale"
38     set(_dir "${LYX_DATA_SUBDIR}locale")
39   elseif(UNIX)
40     set(_dir "share/locale")
41   else()
42     message(FATAL_ERROR "Unhandled platform")
43   endif()
44   set(${_result} ${_dir} PARENT_SCOPE)
45 endfunction()
46
47 function(get_data_destination _result)
48   set(_dir)
49   if(WIN32)
50     set(_dir "${LYX_DATA_SUBDIR}")
51   elseif(APPLE)
52     # "Contents/Resources/"
53     set(_dir "${LYX_DATA_SUBDIR}")
54   elseif(UNIX)
55     set(_dir "${LYX_DATA_SUBDIR}")
56   else()
57     message(FATAL_ERROR "Unhandled platform")
58   endif()
59   set(${_result} ${_dir} PARENT_SCOPE)
60 endfunction()
61
62 function(get_font_destination _result)
63   set(_dir)
64   if(WIN32)
65     set(_dir "${LYX_DATA_SUBDIR}fonts/")
66   elseif(APPLE)
67     # "Contents/Resources/fonts/"
68     set(_dir "${LYX_DATA_SUBDIR}fonts/")
69   elseif(UNIX)
70     # at least on ubuntu
71     # ${LYX_DATA_SUBDIR}: Satisfy lyx because GuiFontLoader.cpp searches there
72     # share/fonts: because math-editor uses system font
73     set(_dir "${LYX_DATA_SUBDIR}fonts/")
74   else()
75     message(FATAL_ERROR "Unhandled platform")
76   endif()
77   set(${_result} ${_dir} PARENT_SCOPE)
78 endfunction()
79
80 function(get_tex_destination _result)
81   set(_dir)
82   if(WIN32)
83     set(_dir "${LYX_DATA_SUBDIR}tex/")
84   elseif(APPLE)
85     # "Contents/Resources/tex/"
86     set(_dir "${LYX_DATA_SUBDIR}tex/")
87   elseif(UNIX)
88     set(_dir "${LYX_DATA_SUBDIR}tex/")
89   else()
90     message(FATAL_ERROR "Unhandled platform")
91   endif()
92   set(${_result} ${_dir} PARENT_SCOPE)
93 endfunction()
94