1 # This file is part of Telegram Desktop,
2 # the official desktop application for the Telegram messaging service.
4 # For license and copyright information please follow this link:
5 # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
8 # target_precompile_headers with COMPILE_LANGUAGE restriction.
9 cmake_minimum_required(VERSION 3.23)
11 cmake_minimum_required(VERSION 3.16)
14 cmake_policy(SET CMP0149 NEW)
17 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
19 include(cmake/validate_special_target.cmake)
20 include(cmake/version.cmake)
21 desktop_app_parse_version(Telegram/build/version)
23 set(project_langs C CXX)
25 list(APPEND project_langs OBJC OBJCXX)
27 list(APPEND project_langs ASM)
31 LANGUAGES ${project_langs}
32 VERSION ${desktop_app_version_cmake}
33 DESCRIPTION "Official Telegram Desktop messenger"
34 HOMEPAGE_URL "https://desktop.telegram.org"
36 set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Telegram)
38 get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH)
39 get_filename_component(submodules_loc "Telegram" REALPATH)
40 get_filename_component(cmake_helpers_loc "cmake" REALPATH)
42 if (NOT DESKTOP_APP_USE_PACKAGED AND WIN32)
43 set(Python3_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/python/Scripts/python)
46 include(cmake/variables.cmake)
47 include(cmake/nice_target_sources.cmake)
48 include(cmake/target_compile_options_if_exists.cmake)
49 include(cmake/target_link_frameworks.cmake)
50 include(cmake/target_link_optional_libraries.cmake)
51 include(cmake/target_link_options_if_exists.cmake)
52 include(cmake/target_link_static_libraries.cmake)
53 include(cmake/init_target.cmake)
54 include(cmake/generate_target.cmake)
55 include(cmake/nuget.cmake)
56 include(cmake/validate_d3d_compiler.cmake)
57 include(cmake/target_prepare_qrc.cmake)
59 include(cmake/options.cmake)
61 if (NOT DESKTOP_APP_USE_PACKAGED)
63 set(qt_version 5.15.13)
68 include(cmake/external/qt/package.cmake)
70 set(desktop_app_skip_libs
75 add_subdirectory(cmake)
76 add_subdirectory(Telegram)