-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
74 lines (62 loc) · 1.84 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.1.0)
project("mDownloader")
if (UNIX)
set(CMAKE_CXX_FLAGS -Wall)
endif (UNIX)
if (WIN32)
set(CMAKE_PREFIX_PATH "D:\\Qt\\Qt5.9.8\\5.9.8\\msvc2017_64")
endif(WIN32)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(src/protocols src/db src/protocols/http src/protocols/ftp src/ src/io src/ui)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)
find_package(Qt5Sql CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
if (UNIX)
find_package(Qt5DBus CONFIG REQUIRED)
endif(UNIX)
set(mDownloader_SRCS
src/main.cpp
src/io/advio.cpp
src/io/block.cpp
src/debug.cpp
src/downloader.cpp
src/protocols/ftp/ftp.cpp
src/protocols/ftp/ftpparser.cpp
src/protocols/ftp/ftpplugin.cpp
src/protocols/header.cpp
src/protocols/http/http.cpp
src/protocols/http/httpplugin.cpp
src/protocols/plugin.cpp
src/progressbar.cpp
src/protocols/proxy.cpp
src/task.cpp
src/protocols/url.cpp
src/utils.cpp
src/status.cpp
src/ui/newtask.cpp
src/ui/mainwindow.cpp
src/ui/jobview.cc
src/ui/errormessagebox.cpp
src/ui/newtask.ui
src/mDownloader.qrc
src/db/dbmanager.cpp
src/translations/mDownloader_zh_CN.ts
)
qt5_add_resources(src/mDownloader.qrc)
if (UNIX)
add_executable(mDownloader ${mDownloader_SRCS})
elseif (WIN32)
add_executable(mDownloader WIN32 ${mDownloader_SRCS})
endif (UNIX)
if (UNIX)
target_link_libraries(mDownloader Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Network Qt5::Sql Qt5::DBus)
elseif (WIN32)
target_link_libraries(mDownloader Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Network Qt5::Sql PowrProf.lib)
endif (UNIX)
install(TARGETS mDownloader
RUNTIME DESTINATION /usr/bin)