CMakeLists.txt 3.46 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
Jeremy Whiting's avatar
Jeremy Whiting committed
2

3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "21")
5
set (RELEASE_SERVICE_VERSION_MINOR "07")
6
7
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
8

9
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
10

11
set(QT_MIN_VERSION 5.12.0)
12
set(KF5_MIN_VERSION 5.68.0)
13

14
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED)
15
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH})
16

Jeremy Whiting's avatar
Jeremy Whiting committed
17
18
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDECompilerSettings NO_POLICY_SCOPE)
Jeremy Whiting's avatar
Jeremy Whiting committed
20
21
include(ECMInstallIcons)
include(ECMAddAppIcon)
22
include(ECMSetupVersion)
23
include(ECMQtDeclareLoggingCategory)
24
include(FeatureSummary)
25
26
27
include(CheckIncludeFile)

check_include_file("linux/input.h" HAVE_LINUX_INPUT_H)
28

29
30
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Widgets X11Extras)

31
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Jeremy Whiting's avatar
Jeremy Whiting committed
32
    I18n
33
    Config
Jeremy Whiting's avatar
Jeremy Whiting committed
34
    CoreAddons
35
    Crash
36
    DBusAddons
Jeremy Whiting's avatar
Jeremy Whiting committed
37
38
    DNSSD
    DocTools
39
    Notifications
Jeremy Whiting's avatar
Jeremy Whiting committed
40
41
    Wallet
    WidgetsAddons
42
    WindowSystem
43
    XmlGui
Jeremy Whiting's avatar
Jeremy Whiting committed
44
)
Dariusz Mikulski's avatar
Dariusz Mikulski committed
45

Jeremy Whiting's avatar
Jeremy Whiting committed
46
find_package(X11 REQUIRED)
47

48
49
50
51
52
53
54
55
56
57
find_package(XCB REQUIRED COMPONENTS
    XCB
    RENDER
    SHAPE
    XFIXES
    DAMAGE
    SHM
    IMAGE
)

Jeremy Whiting's avatar
Jeremy Whiting committed
58
59
60
61
if(WIN32)
    set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
    set(CMAKE_REQUIRED_INCLUDES  ${KDEWIN32_INCLUDES})
endif(WIN32)
62

63
64
65
add_definitions(
    -DQT_DEPRECATED_WARNINGS
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050600
66
    -DQT_USE_QSTRINGBUILDER
67
    -DQT_NO_CAST_TO_ASCII
68
    -DQT_NO_CAST_FROM_ASCII
69
    -DQT_NO_CAST_FROM_BYTEARRAY
70
71
72
73
74
75
    -DQT_STRICT_ITERATORS
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_NO_SIGNALS_SLOTS_KEYWORDS
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
)

Jeremy Whiting's avatar
Jeremy Whiting committed
76
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
Dariusz Mikulski's avatar
Dariusz Mikulski committed
77

78
79
find_package(LibVNCServer REQUIRED)

Jan Grulich's avatar
Jan Grulich committed
80
81
82
83
84
85
86
87
88
89
90
91

pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
add_feature_info(PipeWire PipeWire_FOUND "Required for pipewire screencast plugin")

find_package(gbm)
set_package_properties(gbm PROPERTIES
    TYPE OPTIONAL
    PURPOSE "Required for dma-buf support in pipewire screencast plugin."
)

find_package(EGL)
set_package_properties(EGL PROPERTIES
92
    TYPE OPTIONAL
Jan Grulich's avatar
Jan Grulich committed
93
    PURPOSE "Required for dma-buf support in pipewire screencast plugin."
94
95
)

Jan Grulich's avatar
Jan Grulich committed
96
97
98
99
100
101
102
find_package(epoxy)
set_package_properties(Epoxy PROPERTIES DESCRIPTION "libepoxy"
    URL "https://github.com/anholt/libepoxy"
    TYPE OPTIONAL
    PURPOSE "Required for dma-buf support in pipewire screencast plugin."
)

103
104
105
106
107
if(EGL_FOUND AND gbm_FOUND AND Epoxy_FOUND)
  set (HAVE_DMA_BUF TRUE)
else()
  set (HAVE_DMA_BUF FALSE)
endif()
Jan Grulich's avatar
Jan Grulich committed
108

109
110
111
ecm_setup_version(PROJECT
                  VARIABLE_PREFIX KRFB
                  VERSION_HEADER "krfb_version.h")
112
113
114
115
116

include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
                     "${CMAKE_CURRENT_SOURCE_DIR}/krfb"
                     "${CMAKE_CURRENT_SOURCE_DIR}/krfb/ui"
)
117

118
119
if(Q_WS_X11)
  if(NOT X11_XTest_FOUND)
120
    message(FATAL_ERROR "krfb requires the libXtst (https://xorg.freedesktop.org) to be built")
121
122
123
  endif(NOT X11_XTest_FOUND)
endif(Q_WS_X11)

124
add_subdirectory(events)
125
add_subdirectory(krfb)
126
add_subdirectory(framebuffers)
127
add_subdirectory(doc)
128
add_subdirectory(icons)
Jeremy Whiting's avatar
Jeremy Whiting committed
129

130
131
132
133
134
135
ecm_qt_install_logging_categories(
    EXPORT KRFB
    FILE krfb.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)

Jeremy Whiting's avatar
Jeremy Whiting committed
136
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)