mirror of https://github.com/procxx/kepka.git
Initial Windows Debug build with cmake.
This commit is contained in:
parent
85060cd655
commit
61723bd794
CMakeLists.txt
Telegram
cmake
CMakeLists.txt
external
init_target.cmakenice_target_sources.cmake
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
cmake_policy(SET CMP0076 NEW)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ add_subdirectory(lib_base)
|
|||
add_subdirectory(lib_ui)
|
||||
add_subdirectory(lib_tl)
|
||||
add_subdirectory(lib_spellcheck)
|
||||
add_subdirectory(lib_storage)
|
||||
add_subdirectory(lib_lottie)
|
||||
add_subdirectory(lib_rlottie)
|
||||
add_subdirectory(codegen)
|
||||
|
@ -54,17 +55,33 @@ generate_styles(Telegram ${src_loc} "${style_files}" "${dependent_style_files}")
|
|||
generate_lang(Telegram ${res_loc}/langs/lang.strings)
|
||||
generate_numbers(Telegram ${res_loc}/numbers.txt)
|
||||
|
||||
set_target_properties(Telegram PROPERTIES AUTOMOC ON)
|
||||
set_target_properties(Telegram PROPERTIES AUTORCC ON)
|
||||
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
lib_base
|
||||
lib_crl
|
||||
lib_ui
|
||||
lib_tl
|
||||
lib_spellcheck
|
||||
lib_storage
|
||||
lib_lottie
|
||||
lib_rlottie
|
||||
lib_mtproto
|
||||
lib_scheme
|
||||
lib_export
|
||||
lib_ffmpeg
|
||||
lib_tgvoip
|
||||
lib_lz4
|
||||
external_qt
|
||||
external_openssl
|
||||
external_crash_reports
|
||||
external_auto_updates
|
||||
external_zlib
|
||||
external_opus
|
||||
external_openal
|
||||
)
|
||||
|
||||
set(telegram_sources
|
||||
|
@ -904,35 +921,55 @@ PRIVATE
|
|||
qt_static_plugins.cpp
|
||||
settings.cpp
|
||||
settings.h
|
||||
|
||||
# platforms: !win
|
||||
# <(minizip_loc)/crypt.h
|
||||
# <(minizip_loc)/ioapi.c
|
||||
# <(minizip_loc)/ioapi.h
|
||||
# <(minizip_loc)/zip.c
|
||||
# <(minizip_loc)/zip.h
|
||||
# <(minizip_loc)/unzip.c
|
||||
# <(minizip_loc)/unzip.h
|
||||
|
||||
# platforms: win
|
||||
# <(res_loc)/winrc/Telegram.rc
|
||||
|
||||
# platforms: mac
|
||||
# <(sp_media_key_tap_loc)/SPMediaKeyTap.m
|
||||
# <(sp_media_key_tap_loc)/SPMediaKeyTap.h
|
||||
# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.m
|
||||
# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.h
|
||||
)
|
||||
nice_target_sources(Telegram ${src_loc} "${telegram_sources}")
|
||||
|
||||
set(telegram_resources
|
||||
PRIVATE
|
||||
qrc/emoji_1.qrc
|
||||
qrc/emoji_2.qrc
|
||||
qrc/emoji_3.qrc
|
||||
qrc/emoji_4.qrc
|
||||
qrc/emoji_5.qrc
|
||||
qrc/emoji_preview.qrc
|
||||
qrc/telegram/telegram.qrc
|
||||
qrc/telegram/sounds.qrc
|
||||
winrc/Telegram.rc
|
||||
winrc/Telegram.manifest
|
||||
)
|
||||
nice_target_sources(Telegram ${res_loc} "${telegram_resources}")
|
||||
|
||||
force_include(Telegram stdafx.h)
|
||||
|
||||
if (WIN32)
|
||||
# message(${CMAKE_GENERATOR})
|
||||
# mt.exe -manifest "${res_loc}/winrc/Telegram.manifest" "-inputresource:\"$<TARGET_FILE:Telegram>\";#1" "-outputresource:\"$<TARGET_FILE:Telegram>\";#1" >NUL
|
||||
# set(hash_symbol "#")
|
||||
# set(release $<CONFIG:Release>)
|
||||
# add_custom_command(
|
||||
# TARGET
|
||||
# Telegram
|
||||
# POST_BUILD COMMAND
|
||||
# $<IF:${release},mt.exe,echo.> $<${release}:-manifest> $<${release}:"${res_loc}/winrc/Telegram.manifest"> $<${release}:-inputresource:"$<TARGET_FILE:Telegram>"$<SEMICOLON>${hash_symbol}1> $<${release}:-outputresource:"$<TARGET_FILE:Telegram>"$<SEMICOLON>${hash_symbol}1> $<${release}:$<ANGLE-R>NUL>
|
||||
# COMMENT
|
||||
# $<IF:${release},"Appending compatibility manifest.","Finalizing build.">
|
||||
# )
|
||||
else()
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
external_minizip
|
||||
)
|
||||
if (APPLE)
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
external_sp_media_key_tap
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(Telegram
|
||||
PRIVATE
|
||||
${src_loc}
|
||||
${libs_loc}/zlib
|
||||
${libs_loc}/lzma/C
|
||||
${libs_loc}/openal-soft/include
|
||||
${third_party_loc}/minizip
|
||||
)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 302d42fc201f9a8b973ba152e04cf804b0d9d521
|
||||
Subproject commit 782436c567ba1a6a7aa294a5a6e09965506d3395
|
|
@ -14,7 +14,17 @@ PUBLIC
|
|||
${libs_loc}/ffmpeg
|
||||
)
|
||||
|
||||
target_link_directories(lib_ffmpeg
|
||||
PUBLIC
|
||||
${libs_loc}/ffmpeg
|
||||
)
|
||||
|
||||
target_link_libraries(lib_ffmpeg
|
||||
PUBLIC
|
||||
lib_base
|
||||
${libs_loc}/ffmpeg/libavformat/libavformat.a
|
||||
${libs_loc}/ffmpeg/libavcodec/libavcodec.a
|
||||
${libs_loc}/ffmpeg/libavutil/libavutil.a
|
||||
${libs_loc}/ffmpeg/libswresample/libswresample.a
|
||||
${libs_loc}/ffmpeg/libswscale/libswscale.a
|
||||
)
|
||||
|
|
|
@ -726,6 +726,11 @@ PRIVATE
|
|||
${libs_loc}/opus/include
|
||||
)
|
||||
|
||||
target_compile_options(lib_tgvoip
|
||||
PRIVATE
|
||||
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
|
||||
)
|
||||
|
||||
target_link_libraries(lib_tgvoip
|
||||
PRIVATE
|
||||
external_openssl
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b8127c8aa2d55a3e110249e63b766db5cbe82f97
|
||||
Subproject commit 3ef08c5aec24e544b8fbc6372c9baf56993aa0b0
|
|
@ -1 +1 @@
|
|||
Subproject commit 3f9823f939eeb9524d5b15d30993589b8860a168
|
||||
Subproject commit 348f27fcc64a82e0a3ae3ec4dbb302e5bd9f5bab
|
|
@ -1 +1 @@
|
|||
Subproject commit 6803e74111186443af5be9ed1eae190536309e33
|
||||
Subproject commit 3f375807eacd3411dfe8644df7b0dc494536d3de
|
|
@ -1 +1 @@
|
|||
Subproject commit d32f772e5274e8490ade20e88c6bfa10b8ecfee5
|
||||
Subproject commit 110a17089a2b18e93edf77a0adf596df92e9def0
|
|
@ -29,8 +29,6 @@ if (WIN32)
|
|||
_WINDOWS
|
||||
_UNICODE
|
||||
UNICODE
|
||||
# HAVE_STDINT_H
|
||||
# ZLIB_WINAPI
|
||||
_SCL_SECURE_NO_WARNINGS
|
||||
_USING_V110_SDK71_
|
||||
NOMINMAX
|
||||
|
@ -50,6 +48,10 @@ if (WIN32)
|
|||
/wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior"
|
||||
/Zc:wchar_t- # don't tread wchar_t as builtin type
|
||||
)
|
||||
target_link_options(common_no_ranges
|
||||
INTERFACE
|
||||
/NODEFAULTLIB:LIBCMT
|
||||
)
|
||||
target_link_libraries(common_no_ranges
|
||||
INTERFACE
|
||||
winmm
|
||||
|
@ -79,7 +81,8 @@ if (WIN32)
|
|||
UxTheme
|
||||
DbgHelp
|
||||
Rstrtmgr
|
||||
)
|
||||
Crypt32
|
||||
)
|
||||
else()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -4,3 +4,7 @@ add_subdirectory(variant)
|
|||
add_subdirectory(ranges)
|
||||
add_subdirectory(gsl)
|
||||
add_subdirectory(crash_reports)
|
||||
add_subdirectory(auto_updates)
|
||||
add_subdirectory(zlib)
|
||||
add_subdirectory(opus)
|
||||
add_subdirectory(openal)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
add_library(external_auto_updates INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
if (WIN32)
|
||||
add_subdirectory(lzma)
|
||||
target_link_libraries(external_auto_updates
|
||||
INTERFACE
|
||||
external_lzma
|
||||
)
|
||||
else()
|
||||
add_subdirectory(xz)
|
||||
target_link_libraries(external_auto_updates
|
||||
INTERFACE
|
||||
external_xz
|
||||
)
|
||||
endif()
|
|
@ -0,0 +1,16 @@
|
|||
add_library(external_lzma INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
target_include_directories(external_lzma SYSTEM
|
||||
INTERFACE
|
||||
${libs_loc}/lzma/C
|
||||
)
|
||||
|
||||
target_link_directories(external_lzma
|
||||
INTERFACE
|
||||
${libs_loc}/lzma/C/Util/LzmaLib/$<IF:$<CONFIG:Debug>,Debug,Release>
|
||||
)
|
||||
|
||||
target_link_libraries(external_lzma
|
||||
INTERFACE
|
||||
LzmaLib
|
||||
)
|
|
@ -1,8 +1,7 @@
|
|||
add_library(external_crash_reports INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
add_subdirectory(breakpad)
|
||||
|
||||
if (WIN32)
|
||||
add_subdirectory(breakpad)
|
||||
target_link_libraries(external_crash_reports
|
||||
INTERFACE
|
||||
external_breakpad
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
add_library(external_openal INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
target_include_directories(external_openal SYSTEM
|
||||
INTERFACE
|
||||
${libs_loc}/openal-soft/include
|
||||
)
|
||||
|
||||
target_link_directories(external_openal
|
||||
INTERFACE
|
||||
${libs_loc}/openal-soft/build/$<IF:$<CONFIG:Debug>,Debug,Release>
|
||||
)
|
||||
|
||||
target_link_libraries(external_openal
|
||||
INTERFACE
|
||||
OpenAL32
|
||||
)
|
|
@ -4,3 +4,14 @@ target_include_directories(external_openssl SYSTEM
|
|||
INTERFACE
|
||||
${libs_loc}/openssl_1_1_1/include
|
||||
)
|
||||
|
||||
target_link_directories(external_openssl
|
||||
INTERFACE
|
||||
${libs_loc}/openssl_1_1_1/out32$<$<CONFIG:Debug>:.dbg>
|
||||
)
|
||||
|
||||
target_link_libraries(external_openssl
|
||||
INTERFACE
|
||||
libcrypto
|
||||
libssl
|
||||
)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
add_library(external_opus INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
target_include_directories(external_opus SYSTEM
|
||||
INTERFACE
|
||||
${libs_loc}/opus/include
|
||||
)
|
||||
|
||||
target_link_directories(external_opus
|
||||
INTERFACE
|
||||
${libs_loc}/opus/win32/VS2015/Win32/$<IF:$<CONFIG:Debug>,Debug,Release>
|
||||
)
|
||||
|
||||
target_link_libraries(external_opus
|
||||
INTERFACE
|
||||
opus
|
||||
)
|
|
@ -0,0 +1,24 @@
|
|||
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
target_include_directories(external_zlib SYSTEM
|
||||
INTERFACE
|
||||
${libs_loc}/zlib
|
||||
${libs_loc}/zlib/contrib/minizip
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_compile_definitions(external_zlib
|
||||
INTERFACE
|
||||
ZLIB_WINAPI
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_directories(external_zlib
|
||||
INTERFACE
|
||||
${libs_loc}/zlib/contrib/vstudio/vc14/x86/ZlibStat$<IF:$<CONFIG:Debug>,Debug,ReleaseWithoutAsm>
|
||||
)
|
||||
|
||||
target_link_libraries(external_zlib
|
||||
INTERFACE
|
||||
zlibstat
|
||||
)
|
|
@ -8,6 +8,12 @@ function(init_target_no_ranges target_name) # init_target(my_target folder_name)
|
|||
init_target_folder(${target_name} "${ARGV1}")
|
||||
set_property(TARGET ${target_name} PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
if (WIN32)
|
||||
target_compile_options(${target_name}
|
||||
INTERFACE
|
||||
/W1
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(${target_name} PUBLIC common_no_ranges)
|
||||
endfunction()
|
||||
|
||||
|
|
|
@ -11,16 +11,16 @@ function(nice_target_sources target_name src_loc list)
|
|||
set(writing_now ${file})
|
||||
else()
|
||||
set(full_name ${src_loc}/${file})
|
||||
if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\\." OR ${file} MATCHES "/windows/")
|
||||
if (${file} MATCHES "(^|/)win/" OR ${file} MATCHES "(^|/)winrc/" OR ${file} MATCHES "(^|/)windows/" OR ${file} MATCHES "[_\\/]win\\.")
|
||||
list(APPEND not_mac_sources ${full_name})
|
||||
list(APPEND not_linux_sources ${full_name})
|
||||
elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\\." OR ${file} MATCHES "/darwin/")
|
||||
elseif (${file} MATCHES "(^|/)mac/" OR ${file} MATCHES "(^|/)darwin/" OR ${file} MATCHES "[_\\/]mac\\.")
|
||||
list(APPEND not_win_sources ${full_name})
|
||||
list(APPEND not_linux_sources ${full_name})
|
||||
elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\\.")
|
||||
elseif (${file} MATCHES "(^|/)linux/" OR ${file} MATCHES "[_\\/]linux\\.")
|
||||
list(APPEND not_win_sources ${full_name})
|
||||
list(APPEND not_mac_sources ${full_name})
|
||||
elseif (${file} MATCHES "/posix/" OR ${file} MATCHES "_posix\\.")
|
||||
elseif (${file} MATCHES "(^|/)posix/" OR ${file} MATCHES "[_\\/]posix\\.")
|
||||
list(APPEND not_win_sources ${full_name})
|
||||
endif()
|
||||
if ("${writing_now}" STREQUAL "PRIVATE")
|
||||
|
@ -47,9 +47,12 @@ function(nice_target_sources target_name src_loc list)
|
|||
endif()
|
||||
if (WIN32)
|
||||
set_source_files_properties(${not_win_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
set_source_files_properties(${not_win_sources} PROPERTIES SKIP_AUTOGEN TRUE)
|
||||
elseif (APPLE)
|
||||
set_source_files_properties(${not_mac_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
set_source_files_properties(${not_mac_sources} PROPERTIES SKIP_AUTOGEN TRUE)
|
||||
elseif (LINUX)
|
||||
set_source_files_properties(${not_linux_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
set_source_files_properties(${not_linux_sources} PROPERTIES SKIP_AUTOGEN TRUE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
Loading…
Reference in New Issue