-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
60 lines (45 loc) · 1.55 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
cmake_minimum_required(VERSION 3.0)
project(DoItYourselfBar)
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()
file(STRINGS /etc/os-release distro REGEX "^NAME=.*$")
if(distro MATCHES ".*openSUSE.*")
set(QML_INSTALL_DIR "/usr/lib64/qt5/qml")
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
DBus)
find_package(KF5 ${KF5_MIN_VERSION}
REQUIRED COMPONENTS
Plasma)
plasma_install_package(package org.kde.plasma.doityourselfbar)
set(doityourselfbar_SRCS
plugin/BlockInfo.cpp
plugin/DBusService.cpp
plugin/DoItYourselfBar.cpp
plugin/DoItYourselfBarPlugin.cpp
)
add_library(doityourselfbar SHARED ${doityourselfbar_SRCS})
target_link_libraries(doityourselfbar
Qt5::Qml
Qt5::DBus
KF5::Plasma)
install(TARGETS doityourselfbar DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/doityourselfbar)
install(FILES plugin/qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/doityourselfbar)
ecm_install_icons(ICONS icons/sc-apps-doityourselfbar.svg DESTINATION ${ICON_INSTALL_DIR})