CMakeLists.txt 2.64 KB
Newer Older
1
add_definitions(-DTRANSLATION_DOMAIN="oxygen_kdecoration")
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

find_package(KDecoration2 REQUIRED)
find_package(KF5 REQUIRED COMPONENTS CoreAddons ConfigWidgets WindowSystem)
find_package(Qt5 CONFIG REQUIRED COMPONENTS DBus)

### XCB
find_package(XCB COMPONENTS XCB)
set_package_properties(XCB PROPERTIES
  DESCRIPTION "X protocol C-language Binding"
  URL "http://xcb.freedesktop.org"
  TYPE OPTIONAL
  PURPOSE "Required to pass style properties to native Windows on X11 Platform"
)

include_directories(${CMAKE_SOURCE_DIR}/liboxygen)
include_directories(${CMAKE_BINARY_DIR}/liboxygen)

if(UNIX AND NOT APPLE)

  set(OXYGEN_HAVE_X11 ${XCB_XCB_FOUND})
  if (XCB_XCB_FOUND)
    find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras)
  endif()

else()

  set(OXYGEN_HAVE_X11 FALSE)

endif()

################# configuration #################
configure_file(config-oxygen.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-oxygen.h )

################# newt target #################
### plugin classes
set(oxygendecoration_SRCS
    oxygenbutton.cpp
    oxygendecohelper.cpp
    oxygendecoration.cpp
    oxygenexceptionlist.cpp
    oxygensettingsprovider.cpp
    oxygensizegrip.cpp)

kconfig_add_kcfg_files(oxygendecoration_SRCS oxygensettings.kcfgc)

### config classes
### they are kept separately because they might move in a separate library in the future
set(oxygendecoration_config_SRCS
50
    config/oxygenanimationconfigwidget.cpp
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    config/oxygenconfigwidget.cpp
    config/oxygendetectwidget.cpp
    config/oxygenexceptiondialog.cpp
    config/oxygenexceptionlistwidget.cpp
    config/oxygenexceptionmodel.cpp
)

set(oxygendecoration_config_PART_FORMS
   config/ui/oxygenconfigurationui.ui
   config/ui/oxygendetectwidget.ui
   config/ui/oxygenexceptiondialog.ui
   config/ui/oxygenexceptionlistwidget.ui
)

ki18n_wrap_ui(oxygendecoration_config_PART_FORMS_HEADERS ${oxygendecoration_config_PART_FORMS})

### build library
add_library(oxygendecoration MODULE
    ${oxygendecoration_SRCS}
    ${oxygendecoration_config_SRCS}
    ${oxygendecoration_config_PART_FORMS_HEADERS})

target_link_libraries(oxygendecoration
    PUBLIC
75
76
77
        Qt::Core
        Qt::Gui
        Qt::DBus
78
79
    PRIVATE
        oxygenstyle5
80
        oxygenstyleconfig5
81
82
83
84
85
86
87
88
89
90
91
        KDecoration2::KDecoration
        KF5::ConfigCore
        KF5::CoreAddons
        KF5::ConfigWidgets
        KF5::GuiAddons
        KF5::I18n
        KF5::WindowSystem)

if(OXYGEN_HAVE_X11)
  target_link_libraries(oxygendecoration
    PUBLIC
92
      Qt::X11Extras
93
94
95
96
      XCB::XCB)
endif()


97
install(TARGETS oxygendecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration2)
98
install(FILES config/oxygendecorationconfig.desktop DESTINATION  ${SERVICES_INSTALL_DIR})