1
0
Fork 0
cmake_helpers/variables.cmake
2019-11-21 14:54:37 +03:00

58 lines
2.1 KiB
CMake

# 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()