]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/LyXDestinations.cmake
Amend 2d48072e: Get rid of Qt resources
[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     set(_dir "share/${_lyx}/fonts/")
72   else()
73     message(FATAL_ERROR "Unhandled platform")
74   endif()
75   set(${_result} ${_dir} PARENT_SCOPE)
76 endfunction()
77
78 function(get_tex_destination _result)
79   set(_dir)
80   if(WIN32)
81     set(_dir "${LYX_DATA_SUBDIR}tex/")
82   elseif(APPLE)
83     # "Contents/Resources/tex/"
84     set(_dir "${LYX_DATA_SUBDIR}tex/")
85   elseif(UNIX)
86     set(_dir "${LYX_DATA_SUBDIR}tex/")
87   else()
88     message(FATAL_ERROR "Unhandled platform")
89   endif()
90   set(${_result} ${_dir} PARENT_SCOPE)
91 endfunction()
92