forked from gyunaev/birdtray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
87 lines (77 loc) · 2.65 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmake_minimum_required(VERSION 3.1.0)
project(Birdtray CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(SQLite3 REQUIRED)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
set(REQUIRED_MODULES ${SQLITE3_LIBRARIES} Qt5::Core Qt5::Gui Qt5::Widgets)
set(PLATFORM_SOURCES)
set(PLATFORM_HEADERS)
set(EXECUTABLE_OPTIONS)
if (WIN32)
set(EXECUTABLE_OPTIONS WIN32)
ENABLE_LANGUAGE(RC)
add_definitions(-DUNICODE)
set(PLATFORM_SOURCES src/windowtools_win.cpp src/birdtrayeventfilter.cpp
src/processhandle.cpp src/res/birdtray.rc)
set(PLATFORM_HEADERS src/windowtools_win.h src/birdtrayeventfilter.h src/processhandle.h)
else()
find_package(Qt5X11Extras QUIET)
find_library(X11 X11)
list(APPEND REQUIRED_MODULES Qt5::X11Extras ${X11})
set(PLATFORM_SOURCES src/windowtools_x11.cpp)
set(PLATFORM_HEADERS src/windowtools_x11.h)
endif (WIN32)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
include_directories(${SQLITE3_INCLUDE_DIRS} src)
add_definitions(-DQT_DEPRECATED_WARNINGS)
set(SOURCES
src/colorbutton.cpp
src/databaseaccounts.cpp
src/databaseunreadfixer.cpp
src/dialogaddeditaccount.cpp
src/dialogaddeditnewemail.cpp
src/dialogsettings.cpp
src/main.cpp
src/modelaccounttree.cpp
src/modelnewemails.cpp
src/morkparser.cpp
src/setting_newemail.cpp
src/settings.cpp
src/sqlite_statement.cpp
src/trayicon.cpp
src/unreadcounter.cpp
src/utils.cpp
src/windowtools.cpp
src/dialogaddeditaccount.ui
src/dialogaddeditnewemail.ui
src/dialogsettings.ui)
set(HEADERS
src/colorbutton.h
src/databaseaccounts.h
src/databaseunreadfixer.h
src/dialogaddeditaccount.h
src/dialogaddeditnewemail.h
src/dialogsettings.h
src/modelaccounttree.h
src/modelnewemails.h
src/morkparser.h
src/setting_newemail.h
src/settings.h
src/sqlite_statement.h
src/trayicon.h
src/unreadcounter.h
src/utils.h
src/version.h
src/windowtools.h)
set(RESOURCES src/resources.qrc)
source_group("Resources" FILES ${RESOURCES})
qt5_add_resources(RESOURCES_SOURCES ${RESOURCES})
set_source_files_properties(${RESOURCES_SOURCES} PROPERTIES GENERATED ON)
add_executable(birdtray ${EXECUTABLE_OPTIONS}
${SOURCES} ${PLATFORM_SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${PLATFORM_HEADERS})
target_link_libraries(birdtray ${REQUIRED_MODULES})