tdesktop/CMakeLists.txt

75 lines
2.2 KiB
CMake
Raw Normal View History

2019-11-21 12:56:17 +01: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 11:02:15 +02:00
if (APPLE)
# target_precompile_headers with COMPILE_LANGUAGE restriction.
cmake_minimum_required(VERSION 3.23)
else()
cmake_minimum_required(VERSION 3.16)
endif()
2019-11-08 09:27:39 +01:00
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0091 NEW)
2019-11-08 11:05:59 +01:00
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(cmake/validate_special_target.cmake)
include(cmake/version.cmake)
desktop_app_parse_version(Telegram/build/version)
2019-11-21 12:56:17 +01:00
set(project_langs C CXX)
if (APPLE)
2023-05-31 06:28:00 +02:00
list(APPEND project_langs OBJC OBJCXX)
elseif (LINUX)
list(APPEND project_langs ASM)
endif()
2019-11-08 09:27:39 +01:00
project(Telegram
LANGUAGES ${project_langs}
VERSION ${desktop_app_version_cmake}
2019-11-08 09:27:39 +01:00
DESCRIPTION "Official Telegram Desktop messenger"
HOMEPAGE_URL "https://desktop.telegram.org"
)
2019-12-06 11:17:40 +01:00
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Telegram)
2019-11-08 09:27:39 +01:00
2020-03-04 10:19:57 +01:00
get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH)
get_filename_component(submodules_loc "Telegram" REALPATH)
get_filename_component(cmake_helpers_loc "cmake" REALPATH)
2020-03-04 10:19:57 +01:00
2022-12-27 11:37:58 +01:00
if (NOT DESKTOP_APP_USE_PACKAGED AND WIN32)
set(Python3_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/python/Scripts/python)
2022-12-27 11:37:58 +01:00
endif()
include(cmake/variables.cmake)
2019-11-25 16:40:59 +01:00
include(cmake/nice_target_sources.cmake)
include(cmake/target_compile_options_if_exists.cmake)
2023-05-31 06:28:00 +02:00
include(cmake/target_link_frameworks.cmake)
include(cmake/target_link_optional_libraries.cmake)
include(cmake/target_link_options_if_exists.cmake)
2019-12-03 17:11:03 +01:00
include(cmake/target_link_static_libraries.cmake)
2019-11-08 12:08:40 +01:00
include(cmake/init_target.cmake)
include(cmake/generate_target.cmake)
include(cmake/nuget.cmake)
include(cmake/validate_d3d_compiler.cmake)
2021-10-27 18:40:21 +02:00
include(cmake/target_prepare_qrc.cmake)
2019-11-25 16:40:59 +01:00
include(cmake/options.cmake)
if (NOT DESKTOP_APP_USE_PACKAGED)
if (WIN32)
2023-06-07 15:58:09 +02:00
set(qt_version 5.15.10)
2022-09-01 13:55:23 +02:00
elseif (APPLE)
2023-09-21 10:42:54 +02:00
set(qt_version 6.2.5)
endif()
endif()
2019-11-08 13:02:15 +01:00
include(cmake/external/qt/package.cmake)
2019-11-08 09:27:39 +01:00
2020-08-31 11:56:28 +02:00
set(desktop_app_skip_libs
variant
)
2019-11-08 09:27:39 +01:00
add_subdirectory(cmake)
add_subdirectory(Telegram)