2019-11-21 11:56:17 +00:00
|
|
|
# This file is part of Telegram Desktop,
|
|
|
|
# the official desktop application for the Telegram messaging service.
|
|
|
|
#
|
|
|
|
# For license and copyright information please follow this link:
|
|
|
|
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
|
2022-06-15 09:02:15 +00:00
|
|
|
if (APPLE)
|
|
|
|
# target_precompile_headers with COMPILE_LANGUAGE restriction.
|
|
|
|
cmake_minimum_required(VERSION 3.23)
|
|
|
|
else()
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
endif()
|
2023-11-27 00:44:45 +00:00
|
|
|
if (POLICY CMP0149)
|
|
|
|
cmake_policy(SET CMP0149 NEW)
|
|
|
|
endif()
|
2019-11-08 08:27:39 +00:00
|
|
|
|
2019-11-08 10:05:59 +00:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
2020-01-17 08:29:10 +00:00
|
|
|
include(cmake/validate_special_target.cmake)
|
2019-12-06 15:52:44 +00:00
|
|
|
include(cmake/version.cmake)
|
|
|
|
desktop_app_parse_version(Telegram/build/version)
|
2019-11-21 11:56:17 +00:00
|
|
|
|
2023-08-14 04:36:31 +00:00
|
|
|
set(project_langs C CXX)
|
2021-07-20 06:06:22 +00:00
|
|
|
if (APPLE)
|
2023-05-31 04:28:00 +00:00
|
|
|
list(APPEND project_langs OBJC OBJCXX)
|
2023-08-14 04:36:31 +00:00
|
|
|
elseif (LINUX)
|
|
|
|
list(APPEND project_langs ASM)
|
2021-07-20 06:06:22 +00:00
|
|
|
endif()
|
|
|
|
|
2019-11-08 08:27:39 +00:00
|
|
|
project(Telegram
|
2021-07-20 06:06:22 +00:00
|
|
|
LANGUAGES ${project_langs}
|
2019-12-06 15:52:44 +00:00
|
|
|
VERSION ${desktop_app_version_cmake}
|
2019-11-08 08:27:39 +00:00
|
|
|
DESCRIPTION "Official Telegram Desktop messenger"
|
|
|
|
HOMEPAGE_URL "https://desktop.telegram.org"
|
|
|
|
)
|
2019-12-06 10:17:40 +00:00
|
|
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Telegram)
|
2019-11-08 08:27:39 +00:00
|
|
|
|
2020-03-04 09:19:57 +00:00
|
|
|
get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH)
|
|
|
|
get_filename_component(submodules_loc "Telegram" REALPATH)
|
2021-07-19 20:15:04 +00:00
|
|
|
get_filename_component(cmake_helpers_loc "cmake" REALPATH)
|
2020-03-04 09:19:57 +00:00
|
|
|
|
2022-12-27 10:37:58 +00:00
|
|
|
if (NOT DESKTOP_APP_USE_PACKAGED AND WIN32)
|
2023-06-05 04:46:17 +00:00
|
|
|
set(Python3_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/python/Scripts/python)
|
2022-12-27 10:37:58 +00:00
|
|
|
endif()
|
|
|
|
|
2020-01-17 08:29:10 +00:00
|
|
|
include(cmake/variables.cmake)
|
2019-11-25 15:40:59 +00:00
|
|
|
include(cmake/nice_target_sources.cmake)
|
2022-09-21 06:30:02 +00:00
|
|
|
include(cmake/target_compile_options_if_exists.cmake)
|
2023-05-31 04:28:00 +00:00
|
|
|
include(cmake/target_link_frameworks.cmake)
|
|
|
|
include(cmake/target_link_optional_libraries.cmake)
|
2022-09-21 06:30:02 +00:00
|
|
|
include(cmake/target_link_options_if_exists.cmake)
|
2019-12-03 16:11:03 +00:00
|
|
|
include(cmake/target_link_static_libraries.cmake)
|
2019-11-08 11:08:40 +00:00
|
|
|
include(cmake/init_target.cmake)
|
|
|
|
include(cmake/generate_target.cmake)
|
2021-06-22 05:53:20 +00:00
|
|
|
include(cmake/nuget.cmake)
|
2021-07-19 20:15:04 +00:00
|
|
|
include(cmake/validate_d3d_compiler.cmake)
|
2021-10-27 16:40:21 +00:00
|
|
|
include(cmake/target_prepare_qrc.cmake)
|
2019-11-25 15:40:59 +00:00
|
|
|
|
|
|
|
include(cmake/options.cmake)
|
2019-11-08 12:02:15 +00:00
|
|
|
include(cmake/external/qt/package.cmake)
|
2019-11-08 08:27:39 +00:00
|
|
|
|
2020-08-31 09:56:28 +00:00
|
|
|
set(desktop_app_skip_libs
|
2024-03-14 17:50:58 +00:00
|
|
|
glibmm
|
2020-08-31 09:56:28 +00:00
|
|
|
variant
|
|
|
|
)
|
|
|
|
|
2019-11-08 08:27:39 +00:00
|
|
|
add_subdirectory(cmake)
|
|
|
|
add_subdirectory(Telegram)
|