-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
103 lines (91 loc) · 3.82 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required(VERSION 3.1.0)
project(HarpoonClient)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
file(STRINGS src/version.hpp VERSION)
string(REPLACE " " ";" VERSION "${VERSION}")
list(LENGTH VERSION VERSION_LEN)
list(GET VERSION 4 CPACK_PACKAGE_VERSION_MAJOR)
list(GET VERSION 10 CPACK_PACKAGE_VERSION_MINOR)
list(GET VERSION 16 CPACK_PACKAGE_VERSION_PATCH)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
message("HarpoonClient Version ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
find_package(Qt5Widgets)
find_package(Qt5WebSockets)
set(SRC_CLIENT
src/version.hpp
src/main.cpp
src/ChatUi.cpp src/ChatUi.hpp
src/TreeEntry.cpp src/TreeEntry.hpp
src/irc/IrcServer.cpp src/irc/IrcServer.hpp
src/irc/IrcHost.cpp src/irc/IrcHost.hpp
src/irc/IrcChannel.cpp src/irc/IrcChannel.hpp
src/irc/IrcBacklogView.cpp src/irc/IrcBacklogView.hpp
src/GraphicsHandle.cpp src/GraphicsHandle.hpp
src/irc/IrcUserGroup.cpp src/irc/IrcUserGroup.hpp
src/irc/IrcUser.cpp src/irc/IrcUser.hpp
src/irc/IrcChatLine.cpp src/irc/IrcChatLine.hpp
src/SettingsDialog.cpp src/SettingsDialog.hpp
src/HarpoonClient.cpp src/HarpoonClient.hpp
src/models/irc/IrcServerTreeModel.cpp src/models/irc/IrcServerTreeModel.hpp
src/models/irc/IrcChannelTreeModel.cpp src/models/irc/IrcChannelTreeModel.hpp
src/models/irc/IrcUserTreeModel.cpp src/models/irc/IrcUserTreeModel.hpp
src/models/irc/IrcHostTreeModel.cpp src/models/irc/IrcHostTreeModel.hpp
src/models/irc/IrcNickModel.cpp src/models/irc/IrcNickModel.hpp
src/models/SettingsTypeModel.cpp src/models/SettingsTypeModel.hpp
)
qt5_add_resources(ICONS_SRC icons/icons.qrc)
qt5_wrap_ui(ABOUT_HEADERS ui_forms/about.ui)
qt5_wrap_ui(CHATUI_HEADERS ui_forms/client.ui)
qt5_wrap_ui(EDITSERVERENTRY_HEADERS ui_forms/editServerEntry.ui)
qt5_wrap_ui(EDITHOSTENTRY_HEADERS ui_forms/editHostEntry.ui)
qt5_wrap_ui(EDITNICKENTRY_HEADERS ui_forms/editNickEntry.ui)
qt5_wrap_ui(SERVERCONFIGUI_HEADERS ui_forms/serverConfigurationDialog.ui)
qt5_wrap_ui(SETTINGSUI_HEADERS ui_forms/settings.ui)
qt5_wrap_ui(IRCCONFIGUI_HEADERS ui_forms/ircSettings.ui)
add_executable(HarpoonClient WIN32
${SRC_CLIENT}
${ABOUT_HEADERS}
${CHATUI_HEADERS}
${EDITSERVERENTRY_HEADERS}
${EDITHOSTENTRY_HEADERS}
${EDITNICKENTRY_HEADERS}
${SETTINGSUI_HEADERS}
${ICONS_SRC}
${SERVERCONFIGUI_HEADERS}
${IRCCONFIGUI_HEADERS}
)
target_include_directories(HarpoonClient PUBLIC src)
target_link_libraries(HarpoonClient Qt5::Widgets Qt5::WebSockets)
# OS SPECIFIC INSTALL SETTINGS
if(WIN32)
INSTALL(TARGETS HarpoonClient
DESTINATION .)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(InstallRequiredSystemLibraries)
# INCLUDE LIBRARIES IF PRESENT
SET(CPACK_GENERATOR "NSIS")
FILE(GLOB EXT_DLLS "ext/*.dll")
if(EXT_DLLS)
install(FILES ${EXT_DLLS}
DESTINATION .)
endif()
SET(CPACK_NSIS_CONTACT "Manuel Herrmann <[email protected]>")
SET(CPACK_NSIS_URL_INFO_ABOUT "https://www.manuel-herrmann.de")
SET(CPACK_NSIS_HELP_LINK "https://github.com/HarpoonOrg/HarpoonClient")
SET(CPACK_NSIS_MENU_LINKS "HarpoonClient.exe" "HarpoonClient")
#SET(CPACK_CREATE_DESKTOP_LINKS "HarpoonClient.exe")
elseif(UNIX)
INSTALL(TARGETS HarpoonClient
DESTINATION bin)
SET(CPACK_GENERATOR "DEB;TGZ")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Manuel Herrmann")
SET(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
SET(CPACK_MONOLITHIC_INSTALL 1)
endif()
SET(CPACK_PACKAGE_VENDOR "Manuel Herrmann")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "HarpoonClient")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_EXECUTABLES "HarpoonClient" "HarpoonClient")
INCLUDE(CPack)