Use libraries deps from conan

This commit is contained in:
Berkus Decker 2017-11-24 15:30:36 +02:00
parent 5707f0c4e1
commit e2738e7e66
3 changed files with 17 additions and 13 deletions

View File

@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.10)
project(telegram-desktop)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cotire/CMake;${PROJECT_SOURCE_DIR}/modules/")
include(cotire)
@ -13,12 +16,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Ignore automoc-ing generated files (@tbd?)
cmake_policy(SET CMP0071 OLD)
# Needs OpenAL-SOFT
# Install via `brew install openal-soft` and configure with `env OPENALDIR=/usr/local/opt/openal-soft`
find_package(OpenAL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibZip REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(LibLZMA REQUIRED)
find_package(GTK3 3.0 REQUIRED gtk)
find_package(FFmpeg REQUIRED)
@ -27,8 +26,8 @@ find_package(Iconv REQUIRED)
find_library(OPUS_LIB opus)
find_path(OPUS_INCLUDE_DIR opus.h PATHS /usr/local/include/opus)
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
# include_directories(${GTK3_INCLUDE_DIRS})
# link_directories(${GTK3_LIBRARY_DIRS})
if (NOT FFMPEG_SWSCALE_FOUND)
message(FATAL_ERROR "FFmpeg swscale is required")

View File

@ -545,19 +545,19 @@ include_directories(ThirdParty/GSL/include ThirdParty/variant/include
include_directories(SourceFiles SourceFiles/core)
include_directories(${OPENAL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS}
include_directories(${ZLIB_INCLUDE_DIRS}
${LIBZIP_INCLUDE_DIR_ZIP} ${LIBZIP_INCLUDE_DIR_ZIPCONF}
${OPENSSL_INCLUDE_DIR} ${LIBLZMA_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS}
${ICONV_INCLUDE_DIR} ${OPUS_INCLUDE_DIR})
# ${FFMPEG_INCLUDE_DIR}) -- this doesn't work, wtf?
link_directories(${GTK3_LIBRARY_DIRS})
link_directories(${FFMPEG_LIBRARY_DIR})
# link_directories(${GTK3_LIBRARY_DIRS})
# link_directories(${FFMPEG_LIBRARY_DIR})
add_subdirectory(ThirdParty/libtgvoip)
# Shut up for testbuilding, remove me
include_directories(/usr/local/opt/openal-soft/include)
# include_directories(/usr/local/opt/openal-soft/include)
add_definitions(-Wno-switch)
# End remove me
if (WIN32)
@ -588,10 +588,12 @@ add_executable(Telegram WIN32 MACOSX_BUNDLE
target_compile_options(Telegram PRIVATE -Wno-c++1z-extensions)
target_link_libraries(Telegram Qt5::Core Qt5::Widgets Qt5::Network) # crashpad::crashpad_client)
target_link_libraries(Telegram ${LIBLZMA_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}
${OPENAL_LIBRARY} ${FFMPEG_LIBRARIES} ${ICONV_LIBRARIES} ${OPUS_LIB})
target_link_libraries(Telegram ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES}
${FFMPEG_LIBRARIES} ${ICONV_LIBRARIES} ${OPUS_LIB})
target_link_libraries(Telegram tgvoip)
target_link_libraries(Telegram ${CONAN_LIBS})
add_dependencies(Telegram boxes_styles_output)
if (APPLE)

View File

@ -1,5 +1,8 @@
[requires]
openal-soft/1.17.2@hilborn/stable
#openal-soft/1.17.2@hilborn/stable
OpenSSL/1.0.2m@conan/stable
Catch/2.0.1@bincrafters/stable
gsl_microsoft/20171020@bincrafters/stable
[generators]
cmake