forked from celibol/kvantum-on-windows-with-QT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
106 lines (88 loc) · 2.98 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
104
105
cmake_minimum_required(VERSION 3.0)
project(Kvantum)
set(CMAKE_CXX_STANDARD 17)
# supposedly least crappy way to try to encourage
# cmake to play ball with Qt
set(CMAKE_PREFIX_PATH "C:/Qt/5.15.2/msvc2019_64")
find_package(Qt5Widgets)
find_package(Qt5Core)
find_package(Qt5Svg)
if (NOT Qt5Widgets_FOUND)
message("
Qt5 was not found. Please edit the path in this file.
")
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# this tells cmake to include our *current* directory which is our build directory
# in which the Qt tools (moc and uic) will spit out their generated files.
# so for example when you have "include ui_foobar.h" in your code the
# ui_foobar.h is generated by UIC and will be placed in the current dir.
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(Kvantum SHARED
src/eventFiltering.cpp
src/polishing.cpp
src/animation.cpp
src/animation.h
src/blurhelper.cpp
src/blurhelper.h
src/kcolorspaces.cpp
src/kcolorspaces_p.h
src/kcolorutils.h
src/kcolorutils.cpp
src/kguiaddons_colorhelpers_p.h
src/kguiaddons_export.h
src/Kvantum.cpp
src/Kvantum.h
src/pbscolorconfig.h
src/pbscolorconfig.cpp
src/pbscolorscheme.cpp
src/pbscolorscheme.h
src/shortcuthandler.cpp
src/shortcuthandler.h
src/specs.h
src/ThemeConfig.h
src/ThemeConfig.cpp
src/windowmanager.cpp
src/windowmanager.h
src/x11wmmove.cpp
src/x11wmmove.h
src/plugin.h
src/plugin.cpp
default/defaulttheme.qrc
bin/themes/kvantum/DarkLines/DarkLines.qrc
bin/themes/kvantum/KvCurves/KvCurves.qrc
bin/themes/kvantum/KvDarkRed/KvDarkRed.qrc
bin/themes/kvantum/kvGlowDark/kvGlowDark.qrc)
target_link_libraries(Kvantum Qt5::Widgets Qt5::Core Qt5::Svg)
target_include_directories(Kvantum PRIVATE "${CMAKE_CURRENT_LIST_DIR}/src")
target_compile_definitions(Kvantum PRIVATE DATADIR)
add_executable(Test
ThemeTest/main.cpp
ThemeTest/mainwindow.cpp
ThemeTest/mainwindow.h
ThemeTest/mainwindow.ui
ThemeTest/ThemeTest.qrc)
target_link_libraries(Test Qt5::Widgets Qt5::Core)
target_include_directories(Test PRIVATE "${CMAKE_CURRENT_LIST_DIR}/src")
get_property(QT_CORE_INCLUDE_DIRS TARGET Qt5::Core PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
list(GET QT_CORE_INCLUDE_DIRS 0 QT_CORE_MAIN_INCLUDE_DIR)
get_filename_component(QT_MAIN_DIR ${QT_CORE_MAIN_INCLUDE_DIR}/.. ABSOLUTE)
message("-- Qt version ${Qt5Core_VERSION_STRING} was located at ${QT_MAIN_DIR}")
# install build targets
install(TARGETS Test DESTINATION "${CMAKE_CURRENT_LIST_DIR}/bin")
install(TARGETS Kvantum DESTINATION "${CMAKE_CURRENT_LIST_DIR}/bin/styles")
# install Qt dlls
install(FILES
"${QT_MAIN_DIR}/bin/Qt5Core.dll"
"${QT_MAIN_DIR}/bin/Qt5Widgets.dll"
"${QT_MAIN_DIR}/bin/Qt5Svg.dll"
"${QT_MAIN_DIR}/bin/Qt5Gui.dll"
DESTINATION
"${CMAKE_CURRENT_LIST_DIR}/bin")
# install Qt plugins
install(FILES
"${QT_MAIN_DIR}/plugins/platforms/qwindows.dll"
DESTINATION
"${CMAKE_CURRENT_LIST_DIR}/bin/platforms")