forked from desktop-app/cmake_helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.cmake
58 lines (52 loc) · 2.14 KB
/
variables.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
get_filename_component(libs_loc "../Libraries" REALPATH)
get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH)
get_filename_component(submodules_loc "Telegram" REALPATH)
set(DESKTOP_APP_SPECIAL_TARGET "" CACHE STRING "Use special platform target, like 'mas' for Mac App Store.")
option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." OFF)
option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." OFF)
option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON)
function(report_bad_special_target)
message(FATAL_ERROR "Bad special target '${DESKTOP_APP_SPECIAL_TARGET}'")
endfunction()
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL ""
OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp"
OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "mas")
set(disable_autoupdate 1)
endif()
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
if (WIN32)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp")
set(build_uwp 1)
elseif (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL ""
AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win")
report_bad_special_target()
endif()
elseif (APPLE)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx")
set(build_osx 1)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "mas")
set(build_macstore 1)
elseif (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL ""
AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "mac")
report_bad_special_target()
endif()
else()
set(LINUX 1)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux")
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
report_bad_special_target()
endif()
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux32")
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4)
report_bad_special_target()
endif()
elseif (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
report_bad_special_target()
endif()
endif()