Bert Verhelst
9 years ago
484 changed files with 130414 additions and 103116 deletions
@ -0,0 +1,65 @@ |
|||||||
|
cmake_minimum_required(VERSION 3.2) |
||||||
|
cmake_policy(VERSION 3.2) |
||||||
|
|
||||||
|
project(qBittorrent VERSION 3.4.0.0) |
||||||
|
|
||||||
|
set(VER_MAJOR ${qBittorrent_VERSION_MAJOR}) |
||||||
|
set(VER_MINOR ${qBittorrent_VERSION_MINOR}) |
||||||
|
set(VER_BUGFIX ${qBittorrent_VERSION_PATCH}) |
||||||
|
set(VER_BUILD ${qBittorrent_VERSION_TWEAK}) |
||||||
|
set(VER_STATUS "alpha") # Should be empty for stable releases! |
||||||
|
|
||||||
|
# Don't touch the rest part |
||||||
|
set(PROJECT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}") |
||||||
|
|
||||||
|
if (NOT VER_BUILD EQUAL 0) |
||||||
|
set(PROJECT_VERSION "${PROJECT_VERSION}.${VER_BUILD}") |
||||||
|
endif() |
||||||
|
|
||||||
|
set(PROJECT_VERSION "${PROJECT_VERSION}${VER_STATUS}") |
||||||
|
|
||||||
|
add_definitions(-DVERSION_MAJOR=${VER_MAJOR}) |
||||||
|
add_definitions(-DVERSION_MINOR=${VER_MINOR}) |
||||||
|
add_definitions(-DVERSION_BUGFIX=${VER_BUGFIX}) |
||||||
|
add_definitions(-DVERSION_BUILD=${VER_BUILD}) |
||||||
|
|
||||||
|
# os2 { |
||||||
|
# DEFINES += VERSION=\'\"v$${PROJECT_VERSION}\"\' |
||||||
|
# } else { |
||||||
|
add_definitions(-DVERSION="v${PROJECT_VERSION}") |
||||||
|
# } |
||||||
|
list(APPEND CMAKE_MODULE_PATH ${qBittorrent_SOURCE_DIR}/cmake/Modules) |
||||||
|
|
||||||
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og") |
||||||
|
if (UNIX AND NOT APPLE) |
||||||
|
include(GNUInstallDirs) |
||||||
|
endif (UNIX AND NOT APPLE) |
||||||
|
|
||||||
|
if(WIN32) |
||||||
|
include(winconf) |
||||||
|
endif(WIN32) |
||||||
|
|
||||||
|
# we need options here, because they are used not only in "src" subdir, but in the "dist" dir too |
||||||
|
include(CMakeDependentOption) |
||||||
|
|
||||||
|
option(QT5 "Compile using Qt5" ON) |
||||||
|
option(SYSTEM_QTSINGLEAPPLICATION |
||||||
|
"Use the system qtsingleapplication library or shipped one otherwise") |
||||||
|
cmake_dependent_option(SYSTEM_QJSON |
||||||
|
"Use the shipped qjson library or the system one (Qt4 only)" OFF "NOT QT5" OFF) |
||||||
|
|
||||||
|
option(GUI "Allows to disable GUI for headless running. Disables QtDBus and the GeoIP Database" ON) |
||||||
|
|
||||||
|
option(WEBUI "Allows to disable the WebUI." ON) |
||||||
|
|
||||||
|
if (WIN32) |
||||||
|
option(STACKTRACE_WIN "") |
||||||
|
else (WIN32) |
||||||
|
cmake_dependent_option(SYSTEMD "Install the systemd service file (headless only)" OFF |
||||||
|
"NOT GUI" OFF) |
||||||
|
cmake_dependent_option(DBUS "Enable use of QtDBus (GUI only)" ON "GUI" OFF) |
||||||
|
endif(WIN32) |
||||||
|
|
||||||
|
|
||||||
|
add_subdirectory(src) |
||||||
|
add_subdirectory(dist) |
@ -0,0 +1,52 @@ |
|||||||
|
version: '{branch}-{build}' |
||||||
|
|
||||||
|
# Do not build on tags (GitHub only) |
||||||
|
skip_tags: true |
||||||
|
|
||||||
|
os: Visual Studio 2015 |
||||||
|
|
||||||
|
environment: |
||||||
|
REPO_DIR: &REPO_DIR c:\qbittorrent |
||||||
|
CACHE_DIR: &CACHE_DIR c:\qbt_cache |
||||||
|
|
||||||
|
QBT_VER_URL: http://builds.shiki.hu/appveyor/version |
||||||
|
QBT_LIB_URL: http://builds.shiki.hu/appveyor/qbt_libraries.7z |
||||||
|
|
||||||
|
# project directory |
||||||
|
clone_folder: *REPO_DIR |
||||||
|
|
||||||
|
# cache size should < 100MB (after compressing with fastest option): |
||||||
|
# see: https://www.appveyor.com/docs/build-cache#save-update-cache-before-build-finishes |
||||||
|
cache: |
||||||
|
- *CACHE_DIR |
||||||
|
|
||||||
|
install: |
||||||
|
# check if library needs update |
||||||
|
- appveyor DownloadFile "%QBT_VER_URL%" -FileName "c:\version_new" && SET /P newVersion=<"c:\version_new" |
||||||
|
- IF EXIST "%CACHE_DIR%\version" (SET /P oldVersion=<"%CACHE_DIR%\version") |
||||||
|
- IF NOT EXIST "%CACHE_DIR%\version" (SET updateCache=1) |
||||||
|
- IF NOT "%oldVersion%" == "%newVersion%" (SET updateCache=1) |
||||||
|
# update library |
||||||
|
- IF "%updateCache%" == "1" (ECHO "--- Will redownload libraries ---" && |
||||||
|
RMDIR /S /Q "%CACHE_DIR%" & MKDIR "%CACHE_DIR%" && |
||||||
|
appveyor DownloadFile "%QBT_LIB_URL%" -FileName "c:\qbt_lib.7z" && 7z x "c:\qbt_lib.7z" -o"%CACHE_DIR%" > nul && |
||||||
|
COPY "c:\version_new" "%CACHE_DIR%\version") |
||||||
|
# Qt stay compressed in cache |
||||||
|
- 7z x "%CACHE_DIR%\qt5_32.7z" -o"c:\qbt" > nul |
||||||
|
|
||||||
|
before_build: |
||||||
|
# setup env |
||||||
|
- CALL "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" |
||||||
|
- SET PATH=%PATH%;c:\qbt\qt5_32\bin;%CACHE_DIR%\jom; |
||||||
|
# setup project |
||||||
|
- COPY /Y "%CACHE_DIR%\winconf.pri" "%REPO_DIR%" |
||||||
|
- COPY /Y "%CACHE_DIR%\winconf-msvc.pri" "%REPO_DIR%" |
||||||
|
# workarounds |
||||||
|
- MKLINK /J "c:\qbt\base" "%CACHE_DIR%\base" |
||||||
|
|
||||||
|
build_script: |
||||||
|
- cd "%REPO_DIR%" |
||||||
|
- qmake qbittorrent.pro && cd src && qmake src.pro |
||||||
|
- jom -j2 -f Makefile.Release |
||||||
|
|
||||||
|
test: off |
@ -0,0 +1,93 @@ |
|||||||
|
# - Try to find libtorrent-rasterbar |
||||||
|
# |
||||||
|
# If not using pkg-config, you can pre-set LibtorrentRasterbar_CUSTOM_DEFINITIONS |
||||||
|
# for definitions unrelated to Boost's separate compilation (which are already |
||||||
|
# decided by the LibtorrentRasterbar_USE_STATIC_LIBS variable). |
||||||
|
# |
||||||
|
# Once done this will define |
||||||
|
# LibtorrentRasterbar_FOUND - System has libtorrent-rasterbar |
||||||
|
# LibtorrentRasterbar_INCLUDE_DIRS - The libtorrent-rasterbar include directories |
||||||
|
# LibtorrentRasterbar_LIBRARIES - The libraries needed to use libtorrent-rasterbar |
||||||
|
# LibtorrentRasterbar_DEFINITIONS - Compiler switches required for using libtorrent-rasterbar |
||||||
|
# LibtorrentRasterbar_OPENSSL_ENABLED - libtorrent-rasterbar uses and links against OpenSSL |
||||||
|
|
||||||
|
find_package(Threads REQUIRED) |
||||||
|
find_package(PkgConfig QUIET) |
||||||
|
|
||||||
|
if(PKG_CONFIG_FOUND) |
||||||
|
pkg_check_modules(PC_LIBTORRENT_RASTERBAR QUIET libtorrent-rasterbar) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(LibtorrentRasterbar_USE_STATIC_LIBS) |
||||||
|
set(LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) |
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(PC_LIBTORRENT_RASTERBAR_FOUND) |
||||||
|
set(LibtorrentRasterbar_DEFINITIONS ${PC_LIBTORRENT_RASTERBAR_CFLAGS}) |
||||||
|
else() |
||||||
|
if(LibtorrentRasterbar_CUSTOM_DEFINITIONS) |
||||||
|
set(LibtorrentRasterbar_DEFINITIONS ${LibtorrentRasterbar_CUSTOM_DEFINITIONS}) |
||||||
|
else() |
||||||
|
# Without pkg-config, we can't possibly figure out the correct build flags. |
||||||
|
# libtorrent is very picky about those. Let's take a set of defaults and |
||||||
|
# hope that they apply. If not, you the user are on your own. |
||||||
|
set(LibtorrentRasterbar_DEFINITIONS |
||||||
|
-DTORRENT_USE_OPENSSL |
||||||
|
-DTORRENT_DISABLE_GEO_IP |
||||||
|
-DBOOST_ASIO_ENABLE_CANCELIO |
||||||
|
-DUNICODE -D_UNICODE -D_FILE_OFFSET_BITS=64) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(NOT LibtorrentRasterbar_USE_STATIC_LIBS) |
||||||
|
list(APPEND LibtorrentRasterbar_DEFINITIONS |
||||||
|
-DTORRENT_LINKING_SHARED |
||||||
|
-DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK) |
||||||
|
endif() |
||||||
|
endif() |
||||||
|
|
||||||
|
message(STATUS "libtorrent definitions: ${LibtorrentRasterbar_DEFINITIONS}") |
||||||
|
|
||||||
|
find_path(LibtorrentRasterbar_INCLUDE_DIR libtorrent |
||||||
|
HINTS ${PC_LIBTORRENT_RASTERBAR_INCLUDEDIR} ${PC_LIBTORRENT_RASTERBAR_INCLUDE_DIRS} |
||||||
|
PATH_SUFFIXES libtorrent-rasterbar) |
||||||
|
|
||||||
|
find_library(LibtorrentRasterbar_LIBRARY NAMES torrent-rasterbar libtorrent |
||||||
|
HINTS ${PC_LIBTORRENT_RASTERBAR_LIBDIR} ${PC_LIBTORRENT_RASTERBAR_LIBRARY_DIRS}) |
||||||
|
|
||||||
|
if(LibtorrentRasterbar_USE_STATIC_LIBS) |
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) |
||||||
|
endif() |
||||||
|
|
||||||
|
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) |
||||||
|
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIR}) |
||||||
|
|
||||||
|
if(NOT Boost_SYSTEM_FOUND OR NOT Boost_CHRONO_FOUND OR NOT Boost_RANDOM_FOUND) |
||||||
|
find_package(Boost REQUIRED COMPONENTS date_time system chrono random thread) |
||||||
|
set(LibtorrentRasterbar_LIBRARIES |
||||||
|
${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) |
||||||
|
set(LibtorrentRasterbar_INCLUDE_DIRS |
||||||
|
${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
||||||
|
endif() |
||||||
|
|
||||||
|
list(FIND LibtorrentRasterbar_DEFINITIONS -DTORRENT_USE_OPENSSL LibtorrentRasterbar_ENCRYPTION_INDEX) |
||||||
|
if(LibtorrentRasterbar_ENCRYPTION_INDEX GREATER -1) |
||||||
|
find_package(OpenSSL REQUIRED) |
||||||
|
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARIES} ${OPENSSL_LIBRARIES}) |
||||||
|
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS}) |
||||||
|
set(LibtorrentRasterbar_OPENSSL_ENABLED ON) |
||||||
|
endif() |
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs) |
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LibtorrentRasterbar_FOUND to TRUE |
||||||
|
# if all listed variables are TRUE |
||||||
|
find_package_handle_standard_args(LibtorrentRasterbar DEFAULT_MSG |
||||||
|
LibtorrentRasterbar_LIBRARY |
||||||
|
LibtorrentRasterbar_INCLUDE_DIR |
||||||
|
Boost_SYSTEM_FOUND |
||||||
|
Boost_CHRONO_FOUND |
||||||
|
Boost_RANDOM_FOUND) |
||||||
|
|
||||||
|
mark_as_advanced(LibtorrentRasterbar_INCLUDE_DIR LibtorrentRasterbar_LIBRARY |
||||||
|
LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES |
||||||
|
LibtorrentRasterbar_ENCRYPTION_INDEX) |
@ -0,0 +1,81 @@ |
|||||||
|
# - Try to find the QtSingleApplication includes and library |
||||||
|
# which defines |
||||||
|
# |
||||||
|
# QTSINGLEAPPLICATION_FOUND - system has QtSingleApplication |
||||||
|
# QTSINGLEAPPLICATION_INCLUDE_DIR - where to find header QtSingleApplication |
||||||
|
# QTSINGLEAPPLICATION_LIBRARIES - the libraries to link against to use QtSingleApplication |
||||||
|
# QTSINGLEAPPLICATION_LIBRARY - where to find the QtSingleApplication library (not for general use) |
||||||
|
|
||||||
|
# copyright (c) 2013 TI_Eugene ti.eugene@gmail.com |
||||||
|
# |
||||||
|
# Redistribution and use is allowed according to the terms of the FreeBSD license. |
||||||
|
|
||||||
|
SET(QTSINGLEAPPLICATION_FOUND FALSE) |
||||||
|
|
||||||
|
IF(QT4_FOUND) |
||||||
|
message(STATUS "Looking for Qt4 single application library") |
||||||
|
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication |
||||||
|
# standard locations |
||||||
|
/usr/include |
||||||
|
/usr/include/QtSolutions |
||||||
|
# qt4 location except mac's frameworks |
||||||
|
"${QT_INCLUDE_DIR}/QtSolutions" |
||||||
|
# mac's frameworks |
||||||
|
${FRAMEWORK_INCLUDE_DIR}/QtSolutions |
||||||
|
) |
||||||
|
|
||||||
|
SET(QTSINGLEAPPLICATION_NAMES ${QTSINGLEAPPLICATION_NAMES} |
||||||
|
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) |
||||||
|
FIND_LIBRARY(QTSINGLEAPPLICATION_LIBRARY |
||||||
|
NAMES ${QTSINGLEAPPLICATION_NAMES} |
||||||
|
PATHS ${QT_LIBRARY_DIR} |
||||||
|
) |
||||||
|
ELSEIF(Qt5Widgets_FOUND) |
||||||
|
message(STATUS "Looking for Qt5 single application library") |
||||||
|
FOREACH(TOP_INCLUDE_PATH in ${Qt5Widgets_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR}) |
||||||
|
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication ${TOP_INCLUDE_PATH}/QtSolutions) |
||||||
|
|
||||||
|
IF(QTSINGLEAPPLICATION_INCLUDE_DIR) |
||||||
|
BREAK() |
||||||
|
ENDIF() |
||||||
|
ENDFOREACH() |
||||||
|
|
||||||
|
SET(QTSINGLEAPPLICATION_NAMES ${QTSINGLEAPPLICATION_NAMES} |
||||||
|
Qt5Solutions_SingleApplication-2.6 libQt5Solutions_SingleApplication-2.6 |
||||||
|
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) |
||||||
|
GET_TARGET_PROPERTY(QT5_WIDGETSLIBRARY Qt5::Widgets LOCATION) |
||||||
|
GET_FILENAME_COMPONENT(QT5_WIDGETSLIBRARYPATH ${QT5_WIDGETSLIBRARY} PATH) |
||||||
|
|
||||||
|
FIND_LIBRARY(QTSINGLEAPPLICATION_LIBRARY |
||||||
|
NAMES ${QTSINGLEAPPLICATION_NAMES} |
||||||
|
PATHS ${QT5_WIDGETSLIBRARYPATH} |
||||||
|
) |
||||||
|
ENDIF() |
||||||
|
|
||||||
|
IF (QTSINGLEAPPLICATION_LIBRARY AND QTSINGLEAPPLICATION_INCLUDE_DIR) |
||||||
|
|
||||||
|
SET(QTSINGLEAPPLICATION_LIBRARIES ${QTSINGLEAPPLICATION_LIBRARY}) |
||||||
|
SET(QTSINGLEAPPLICATION_FOUND TRUE) |
||||||
|
|
||||||
|
IF (CYGWIN) |
||||||
|
IF(BUILD_SHARED_LIBS) |
||||||
|
# No need to define QTSINGLEAPPLICATION_USE_DLL here, because it's default for Cygwin. |
||||||
|
ELSE(BUILD_SHARED_LIBS) |
||||||
|
SET (QTSINGLEAPPLICATION_DEFINITIONS -DQTSINGLEAPPLICATION_STATIC) |
||||||
|
ENDIF(BUILD_SHARED_LIBS) |
||||||
|
ENDIF (CYGWIN) |
||||||
|
|
||||||
|
ENDIF (QTSINGLEAPPLICATION_LIBRARY AND QTSINGLEAPPLICATION_INCLUDE_DIR) |
||||||
|
|
||||||
|
IF (QTSINGLEAPPLICATION_FOUND) |
||||||
|
IF (NOT QtSingleApplication_FIND_QUIETLY) |
||||||
|
MESSAGE(STATUS "Found QtSingleApplication: ${QTSINGLEAPPLICATION_LIBRARY}") |
||||||
|
MESSAGE(STATUS " includes: ${QTSINGLEAPPLICATION_INCLUDE_DIR}") |
||||||
|
ENDIF (NOT QtSingleApplication_FIND_QUIETLY) |
||||||
|
ELSE (QTSINGLEAPPLICATION_FOUND) |
||||||
|
IF (QtSingleApplication_FIND_REQUIRED) |
||||||
|
MESSAGE(FATAL_ERROR "Could not find QtSingleApplication library") |
||||||
|
ENDIF (QtSingleApplication_FIND_REQUIRED) |
||||||
|
ENDIF (QTSINGLEAPPLICATION_FOUND) |
||||||
|
|
||||||
|
MARK_AS_ADVANCED(QTSINGLEAPPLICATION_INCLUDE_DIR QTSINGLEAPPLICATION_LIBRARY) |
@ -0,0 +1,23 @@ |
|||||||
|
####### |
||||||
|
# Find systemd service dir |
||||||
|
# sets variables |
||||||
|
# SYSTEMD_FOUND |
||||||
|
# SYSTEMD_SERVICES_INSTALL_DIR |
||||||
|
if (NOT SYSTEMD_FOUND) |
||||||
|
pkg_check_modules(SYSTEMD "systemd") |
||||||
|
endif(NOT SYSTEMD_FOUND) |
||||||
|
|
||||||
|
if (SYSTEMD_FOUND AND "${SYSTEMD_SERVICES_INSTALL_DIR}" STREQUAL "") |
||||||
|
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} |
||||||
|
--variable=systemdsystemunitdir systemd |
||||||
|
OUTPUT_VARIABLE SYSTEMD_SERVICES_INSTALL_DIR) |
||||||
|
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SERVICES_INSTALL_DIR |
||||||
|
"${SYSTEMD_SERVICES_INSTALL_DIR}") |
||||||
|
elseif (NOT SYSTEMD_FOUND AND SYSTEMD_SERVICES_INSTALL_DIR) |
||||||
|
message (FATAL_ERROR "Variable SYSTEMD_SERVICES_INSTALL_DIR is\ |
||||||
|
defined, but we can't find systemd using pkg-config") |
||||||
|
endif() |
||||||
|
|
||||||
|
if (SYSTEMD_FOUND) |
||||||
|
message(STATUS "systemd services install dir: ${SYSTEMD_SERVICES_INSTALL_DIR}") |
||||||
|
endif(SYSTEMD_FOUND) |
@ -0,0 +1,38 @@ |
|||||||
|
macro(configure_msvc_runtime) |
||||||
|
if(MSVC) |
||||||
|
# Default to statically-linked runtime. |
||||||
|
if("${MSVC_RUNTIME}" STREQUAL "") |
||||||
|
set(MSVC_RUNTIME "static") |
||||||
|
endif() |
||||||
|
# Set compiler options. |
||||||
|
set(variables |
||||||
|
CMAKE_C_FLAGS_DEBUG |
||||||
|
CMAKE_C_FLAGS_MINSIZEREL |
||||||
|
CMAKE_C_FLAGS_RELEASE |
||||||
|
CMAKE_C_FLAGS_RELWITHDEBINFO |
||||||
|
CMAKE_CXX_FLAGS_DEBUG |
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL |
||||||
|
CMAKE_CXX_FLAGS_RELEASE |
||||||
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO |
||||||
|
) |
||||||
|
if(${MSVC_RUNTIME} STREQUAL "static") |
||||||
|
message(STATUS |
||||||
|
"MSVC -> forcing use of statically-linked runtime." |
||||||
|
) |
||||||
|
foreach(variable ${variables}) |
||||||
|
if(${variable} MATCHES "/MD") |
||||||
|
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}") |
||||||
|
endif() |
||||||
|
endforeach() |
||||||
|
else() |
||||||
|
message(STATUS |
||||||
|
"MSVC -> forcing use of dynamically-linked runtime." |
||||||
|
) |
||||||
|
foreach(variable ${variables}) |
||||||
|
if(${variable} MATCHES "/MT") |
||||||
|
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}") |
||||||
|
endif() |
||||||
|
endforeach() |
||||||
|
endif() |
||||||
|
endif() |
||||||
|
endmacro() |
@ -0,0 +1,16 @@ |
|||||||
|
# - macro similar to target_link_libraries, which links Qt components |
||||||
|
# names of the components are pased in Qt4/Qt5 agnostic way (Core, DBus, Xml...) |
||||||
|
# and the macro links Qt4 ones if QT4_FOUND is set or Qt5 ones if not |
||||||
|
|
||||||
|
macro (target_link_qt_components target) |
||||||
|
if (QT4_FOUND) |
||||||
|
foreach(_cmp ${ARGN}) |
||||||
|
list(APPEND _QT_CMPNTS "Qt4::Qt${_cmp}") |
||||||
|
endforeach() |
||||||
|
else (QT4_FOUND) |
||||||
|
foreach(_cmp ${ARGN}) |
||||||
|
list(APPEND _QT_CMPNTS "Qt5::${_cmp}") |
||||||
|
endforeach() |
||||||
|
endif (QT4_FOUND) |
||||||
|
target_link_libraries(${target} ${_QT_CMPNTS}) |
||||||
|
endmacro() |
@ -0,0 +1,14 @@ |
|||||||
|
if (STACKTRACE_WIN) |
||||||
|
if ("${WINXXBITS}" NOT STREQUAL "Win64") |
||||||
|
add_compile_options(-fno-omit-frame-pointer) |
||||||
|
endif ("${WINXXBITS}" NOT STREQUAL "Win64") |
||||||
|
link_libraries(libdbghelp -Wl,--export-all-symbols) |
||||||
|
endif (STACKTRACE_WIN) |
||||||
|
|
||||||
|
if (("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")) |
||||||
|
link_libraries(-Wl,--dynamicbase) |
||||||
|
endif() |
||||||
|
|
||||||
|
# LIBS += libadvapi32 libshell32 libuser32 |
||||||
|
# LIBS += libcrypto.dll libssl.dll libwsock32 libws2_32 libz libiconv.dll |
||||||
|
# LIBS += libpowrprof |
@ -0,0 +1,21 @@ |
|||||||
|
if (STACKTRACE_WIN) |
||||||
|
if ("${WINXXBITS}" STREQUAL "Win64") |
||||||
|
add_compile_options(-Zi) |
||||||
|
else ("${WINXXBITS}" STREQUAL "Win64") |
||||||
|
# i686 arch requires frame pointer preservation |
||||||
|
add_compile_options(-Oy-) |
||||||
|
endif ("${WINXXBITS}" STREQUAL "Win64") |
||||||
|
link_libraries(dbghelp.lib) |
||||||
|
endif (STACKTRACE_WIN) |
||||||
|
|
||||||
|
# Enable Wide characters |
||||||
|
add_definitions(-DTORRENT_USE_WPATH) |
||||||
|
|
||||||
|
if (NOT QT5) |
||||||
|
# Qt4 does not detect it itself |
||||||
|
add_definitions(-DQ_COMPILER_INITIALIZER_LISTS) |
||||||
|
endif (NOT QT5) |
||||||
|
|
||||||
|
include(MacroConfigureMSVCRuntime) |
||||||
|
set(MSVC_RUNTIME "dynamic") |
||||||
|
configure_msvc_runtime() |
@ -0,0 +1,86 @@ |
|||||||
|
# Settings for compiling qBittorrent on Windows |
||||||
|
|
||||||
|
# We want to link with static version of |
||||||
|
# libtorrent |
||||||
|
set(LibtorrentRasterbar_USE_STATIC_LIBS True) |
||||||
|
set(LibtorrentRasterbar_CUSTOM_DEFINITIONS |
||||||
|
-DBOOST_ALL_NO_LIB -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 |
||||||
|
-DBOOST_ASIO_SEPARATE_COMPILATION |
||||||
|
-DBOOST_EXCEPTION_DISABLE |
||||||
|
-DBOOST_SYSTEM_STATIC_LINK=1 |
||||||
|
-DTORRENT_USE_OPENSSL |
||||||
|
-DUNICODE |
||||||
|
-D_UNICODE |
||||||
|
-DWIN32 |
||||||
|
-D_WIN32 |
||||||
|
-DWIN32_LEAN_AND_MEAN |
||||||
|
-D_WIN32_WINNT=0x0501 |
||||||
|
-D_WIN32_IE=0x0500 |
||||||
|
-D_CRT_SECURE_NO_DEPRECATE |
||||||
|
-D_SCL_SECURE_NO_DEPRECATE |
||||||
|
-D__USE_W32_SOCKETS |
||||||
|
-D_FILE_OFFSET_BITS=64) |
||||||
|
|
||||||
|
# and boost |
||||||
|
set(Boost_USE_STATIC_LIBS True) |
||||||
|
# set(Boost_USE_STATIC_RUNTIME True) |
||||||
|
|
||||||
|
# Here we assume that all required libraries are installed into the same prefix |
||||||
|
# with usual unix subdirectories (bin, lib, include) |
||||||
|
# if so, we just need to set CMAKE_SYSTEM_PREFIX_PATH |
||||||
|
# If it is not the case, individual paths need to be specified manually (see below) |
||||||
|
set(COMMON_INSTALL_PREFIX "c:/usr") |
||||||
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${COMMON_INSTALL_PREFIX}") |
||||||
|
|
||||||
|
# If two version of Qt are installed, separate prefixes are needed most likely |
||||||
|
set(QT4_INSTALL_PREFIX "${COMMON_INSTALL_PREFIX}/lib/qt4") |
||||||
|
set(QT5_INSTALL_PREFIX "${COMMON_INSTALL_PREFIX}/lib/qt5") |
||||||
|
|
||||||
|
# it is safe to set Qt dirs even if their files are directly in the prefix |
||||||
|
# Qt4 |
||||||
|
if(NOT QT5) |
||||||
|
LIST(APPEND CMAKE_PROGRAM_PATH "${QT4_INSTALL_PREFIX}/bin/") |
||||||
|
endif(NOT QT5) |
||||||
|
|
||||||
|
# Qt5 |
||||||
|
set(Qt5_DIR "${QT5_INSTALL_PREFIX}/lib/cmake/Qt5") |
||||||
|
|
||||||
|
# And now we can set specific values for the Boost and libtorrent libraries. |
||||||
|
# The following values are generated from the paths listed above just for an example |
||||||
|
# they have to be set to actual locations |
||||||
|
|
||||||
|
# Boost |
||||||
|
# set(BOOST_ROOT "${COMMON_INSTALL_PREFIX}") |
||||||
|
# set(Boost_version_suffix "1_59") |
||||||
|
# if a link like boost-version/boost -> boost was created or the boost directory was renamed in the same way, |
||||||
|
# the following needs adjustment |
||||||
|
# set(BOOST_INCLUDEDIR "${COMMON_INSTALL_PREFIX}/include/boost-${Boost_version_suffix}") |
||||||
|
# set(BOOST_LIBRARYDIR "${COMMON_INSTALL_PREFIX}/lib/") |
||||||
|
|
||||||
|
# libtorrent |
||||||
|
|
||||||
|
# set(PC_LIBTORRENT_RASTERBAR_INCLUDEDIR "${COMMON_INSTALL_PREFIX}") |
||||||
|
# set(PC_LIBTORRENT_RASTERBAR_LIBDIR "${COMMON_INSTALL_PREFIX}/lib") |
||||||
|
|
||||||
|
set(AUTOGEN_TARGETS_FOLDER "generated") |
||||||
|
|
||||||
|
set(CMAKE_INSTALL_BINDIR ".") |
||||||
|
|
||||||
|
# Test 32/64 bits |
||||||
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
||||||
|
message(STATUS "Target is 64 bits") |
||||||
|
if (WIN32) |
||||||
|
set(WINXXBITS Win64) |
||||||
|
endif(WIN32) |
||||||
|
else("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
||||||
|
message(STATUS "Target is 32 bits") |
||||||
|
if (WIN32) |
||||||
|
set(WINXXBITS Win32) |
||||||
|
endif(WIN32) |
||||||
|
endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
||||||
|
|
||||||
|
if (MSVC) |
||||||
|
include(winconf-msvc) |
||||||
|
else (MSVC) |
||||||
|
include(winconf-mingw) |
||||||
|
endif (MSVC) |
@ -0,0 +1,39 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE QtCreatorCodeStyle> |
||||||
|
<!-- Written by QtCreator 3.2.82, 2014-11-26T02:08:28. --> |
||||||
|
<qtcreator> |
||||||
|
<data> |
||||||
|
<variable>CodeStyleData</variable> |
||||||
|
<valuemap type="QVariantMap"> |
||||||
|
<value type="bool" key="AlignAssignments">true</value> |
||||||
|
<value type="bool" key="AutoSpacesForTabs">false</value> |
||||||
|
<value type="bool" key="BindStarToIdentifier">false</value> |
||||||
|
<value type="bool" key="BindStarToLeftSpecifier">true</value> |
||||||
|
<value type="bool" key="BindStarToRightSpecifier">false</value> |
||||||
|
<value type="bool" key="BindStarToTypeName">true</value> |
||||||
|
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">false</value> |
||||||
|
<value type="bool" key="IndentAccessSpecifiers">false</value> |
||||||
|
<value type="bool" key="IndentBlockBody">true</value> |
||||||
|
<value type="bool" key="IndentBlockBraces">false</value> |
||||||
|
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value> |
||||||
|
<value type="bool" key="IndentClassBraces">false</value> |
||||||
|
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value> |
||||||
|
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value> |
||||||
|
<value type="bool" key="IndentEnumBraces">false</value> |
||||||
|
<value type="bool" key="IndentFunctionBody">true</value> |
||||||
|
<value type="bool" key="IndentFunctionBraces">false</value> |
||||||
|
<value type="bool" key="IndentNamespaceBody">true</value> |
||||||
|
<value type="bool" key="IndentNamespaceBraces">false</value> |
||||||
|
<value type="int" key="IndentSize">4</value> |
||||||
|
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value> |
||||||
|
<value type="bool" key="IndentSwitchLabels">false</value> |
||||||
|
<value type="int" key="PaddingMode">1</value> |
||||||
|
<value type="bool" key="SpacesForTabs">true</value> |
||||||
|
<value type="int" key="TabSize">4</value> |
||||||
|
</valuemap> |
||||||
|
</data> |
||||||
|
<data> |
||||||
|
<variable>DisplayName</variable> |
||||||
|
<value type="QString">qBittorrent</value> |
||||||
|
</data> |
||||||
|
</qtcreator> |
@ -0,0 +1,10 @@ |
|||||||
|
if (APPLE) |
||||||
|
add_subdirectory(mac) |
||||||
|
else (APPLE) |
||||||
|
if (UNIX) |
||||||
|
add_subdirectory(unix) |
||||||
|
endif (UNIX) |
||||||
|
if (WIN32) |
||||||
|
add_subdirectory(windows) |
||||||
|
endif (WIN32) |
||||||
|
endif (APPLE) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,37 @@ |
|||||||
|
if (SYSTEMD) |
||||||
|
find_package(Systemd) |
||||||
|
if (SYSTEMD_FOUND) |
||||||
|
set(EXPAND_BINDIR ${CMAKE_INSTALL_FULL_BINDIR}) |
||||||
|
configure_file(systemd/qbittorrent-nox.service.in ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox.service @ONLY) |
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox.service |
||||||
|
DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR} |
||||||
|
COMPONENT data) |
||||||
|
endif(SYSTEMD_FOUND) |
||||||
|
endif(SYSTEMD) |
||||||
|
|
||||||
|
|
||||||
|
if (GUI) |
||||||
|
list(APPEND MAN_FILES ${qBittorrent_SOURCE_DIR}/doc/qbittorrent.1) |
||||||
|
else (GUI) |
||||||
|
list(APPEND MAN_FILES ${qBittorrent_SOURCE_DIR}/doc/qbittorrent-nox.1) |
||||||
|
endif (GUI) |
||||||
|
|
||||||
|
install(FILES ${MAN_FILES} |
||||||
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 |
||||||
|
COMPONENT doc) |
||||||
|
|
||||||
|
install(DIRECTORY menuicons/ |
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor |
||||||
|
FILES_MATCHING PATTERN "*.png") |
||||||
|
|
||||||
|
install(FILES ${qBittorrent_SOURCE_DIR}/src/icons/qbittorrent.png |
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps/ |
||||||
|
COMPONENT data) |
||||||
|
|
||||||
|
install(FILES ${qBittorrent_SOURCE_DIR}/src/icons/qBittorrent.desktop |
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/ |
||||||
|
COMPONENT data) |
||||||
|
|
||||||
|
install(FILES qBittorrent.appdata.xml |
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata/ |
||||||
|
COMPONENT data) |
@ -0,0 +1 @@ |
|||||||
|
install(FILES qt.conf DESTINATION ${CMAKE_INSTALL_BINDIR}) |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue