Fix chat preview in non-default themes.
[tdesktop.git] / CMakeLists.txt
blob4e2ac34c256ba19c1e33674b65a7620c488eaeca
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
7 if (APPLE)
8     # target_precompile_headers with COMPILE_LANGUAGE restriction.
9     cmake_minimum_required(VERSION 3.23)
10 else()
11     cmake_minimum_required(VERSION 3.16)
12 endif()
13 if (POLICY CMP0149)
14     cmake_policy(SET CMP0149 NEW)
15 endif()
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)
24 if (APPLE)
25     list(APPEND project_langs OBJC OBJCXX)
26 elseif (LINUX)
27     list(APPEND project_langs ASM)
28 endif()
30 project(Telegram
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)
44 endif()
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)
62     if (WIN32)
63         set(qt_version 5.15.13)
64     elseif (APPLE)
65         set(qt_version 6.2.8)
66     endif()
67 endif()
68 include(cmake/external/qt/package.cmake)
70 set(desktop_app_skip_libs
71     glibmm
72     variant
75 add_subdirectory(cmake)
76 add_subdirectory(Telegram)