This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
77 lines (60 loc) · 2.13 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
cmake_minimum_required(VERSION 3.1)
project(VirtualDesktopBar)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr")
endif()
if(NOT KDE_INSTALL_QMLDIR)
file(STRINGS /etc/os-release distro REGEX "^NAME=.*$")
if(distro MATCHES ".*Ubuntu.*")
set(KDE_INSTALL_QMLDIR "/usr/lib/x86_64-linux-gnu/qt5/qml")
endif()
file(STRINGS /etc/os-release distro REGEX "^NAME=.*$")
if(distro MATCHES ".*openSUSE.*")
set(KDE_INSTALL_QMLDIR "/usr/lib64/qt5/qml")
endif()
file(STRINGS /etc/os-release distro REGEX "^NAME=.*$")
if(distro MATCHES ".*Arch|Manjaro|Solus.*")
set(KDE_INSTALL_QMLDIR "/usr/lib/qt/qml")
endif()
endif()
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
include(ECMInstallIcons)
set(REQUIRED_QT_VERSION 5.9.5)
set(KF5_MIN_VERSION 5.44.0)
find_package(Qt5 ${REQUIRED_QT_VERSION}
CONFIG REQUIRED
Qml
X11Extras)
find_package(KF5 ${KF5_MIN_VERSION}
REQUIRED COMPONENTS
Plasma
WindowSystem
GlobalAccel
XmlGui)
plasma_install_package(package org.kde.plasma.virtualdesktopbar)
set(virtualdesktopbar_SRCS
plugin/DesktopInfo.cpp
plugin/VirtualDesktopBar.cpp
plugin/VirtualDesktopBarPlugin.cpp
)
add_library(virtualdesktopbar SHARED ${virtualdesktopbar_SRCS})
target_link_libraries(virtualdesktopbar
Qt5::Qml
Qt5::X11Extras
KF5::Plasma
KF5::WindowSystem
KF5::GlobalAccel
KF5::XmlGui)
install(TARGETS virtualdesktopbar DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/virtualdesktopbar)
install(FILES plugin/qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/virtualdesktopbar)
ecm_install_icons(ICONS icons/sc-apps-virtualdesktopbar.svg DESTINATION ${ICON_INSTALL_DIR})