Commit 5ab72634 authored by David Jarvie's avatar David Jarvie
Browse files

Use more descriptive name for X11 cmake variable

parent 308aa746
Pipeline #212081 passed with stage
in 2 minutes and 57 seconds
......@@ -128,18 +128,19 @@ configure_file(kalarm-version-string.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kalarm-
if (NOT APPLE)
option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" OFF)
add_feature_info(WITHOUT_X11 ${WITHOUT_X11} "Disable X11 integration, even if X11 is available")
if (NOT WITHOUT_X11)
find_package(X11)
set(KDEPIM_HAVE_X11 ${X11_FOUND})
set(ENABLE_X11 ${X11_FOUND})
if (X11_FOUND)
if (QT_MAJOR_VERSION STREQUAL "5")
find_package(Qt5X11Extras ${QT_REQUIRED_VERSION} REQUIRED NO_MODULE)
else()
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Gui) # qtx11extras_p.h for Qt6 < 6.2
endif()
add_feature_info(ENABLE_X11 ${ENABLE_X11} "Enable use of X11")
endif()
endif()
add_feature_info(WITHOUT_X11 ${WITHOUT_X11} "Build without X11 integration")
endif()
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
......@@ -166,9 +167,10 @@ ecm_qt_install_logging_categories(
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
if(KF5DocTools_FOUND)
if (KF5DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
ki18n_install(po)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -335,7 +335,7 @@ if (ENABLE_WAKE_FROM_SUSPEND)
target_link_libraries(kalarm_bin KF5::AuthCore)
endif()
if(KDEPIM_HAVE_X11)
if (ENABLE_X11)
if (QT_MAJOR_VERSION STREQUAL "5")
target_link_libraries(kalarm_bin Qt${QT_MAJOR_VERSION}::X11Extras ${X11_X11_LIB})
elseif (Qt6_VERSION_MINOR LESS 2)
......
/* config-kalarm.h. Generated by cmake from config-kalarm.h.cmake */
/* Define to 1 if you have the Xlib */
#cmakedefine01 KDEPIM_HAVE_X11
/* Define to 1 if building with Xlib */
#cmakedefine01 ENABLE_X11
/* Define to 1 if wake-from-suspend is enabled */
#cmakedefine01 ENABLE_WAKE_FROM_SUSPEND
......@@ -10,7 +10,7 @@
#include "config-kalarm.h"
#if KDEPIM_HAVE_X11
#if ENABLE_X11
#include <KWindowSystem>
#endif
#include <QGuiApplication>
......@@ -47,7 +47,7 @@ Type currentIdentity()
*/
QRect workArea(int screen)
{
#if KDEPIM_HAVE_X11
#if ENABLE_X11
if (screen < 0)
return KWindowSystem::workArea();
#endif
......
......@@ -33,7 +33,7 @@
#include <KWindowSystem>
#include <KSqueezedTextLabel>
#include <KIdleTime>
#if KDEPIM_HAVE_X11
#if ENABLE_X11
#include <KWindowInfo>
#include <netwm.h>
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
......@@ -1338,7 +1338,7 @@ FullScreenType haveFullScreenWindow(int screen)
{
FullScreenType type = NoFullScreen;
//TODO: implement on Wayland
#if KDEPIM_HAVE_X11
#if ENABLE_X11
if (KWindowSystem::isPlatformX11())
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
......@@ -1367,7 +1367,7 @@ FullScreenType haveFullScreenWindow(int screen)
}
}
}
#endif // KDEPIM_HAVE_X11
#endif // ENABLE_X11
return type;
}
......@@ -1380,7 +1380,7 @@ FullScreenType findFullScreenWindows(const QVector<QRect>& screenRects, QVector<
FullScreenType result = NoFullScreen;
screenTypes.fill(NoFullScreen);
//TODO: implement on Wayland
#if KDEPIM_HAVE_X11
#if ENABLE_X11
if (KWindowSystem::isPlatformX11())
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
......@@ -1430,7 +1430,7 @@ FullScreenType findFullScreenWindows(const QVector<QRect>& screenRects, QVector<
}
}
}
#endif // KDEPIM_HAVE_X11
#endif // ENABLE_X11
return result;
}
......
......@@ -58,7 +58,7 @@ using namespace KHolidays;
#include <KAboutData>
#include <KStandardGuiItem>
#include <QIcon>
#if KDEPIM_HAVE_X11
#if ENABLE_X11
#include <KWindowInfo>
#endif
#include <KWindowSystem>
......@@ -125,7 +125,7 @@ void KAlarmPrefDlg::display()
else
{
mInstance->restoreTab();
#if KDEPIM_HAVE_X11
#if ENABLE_X11
KWindowInfo info = KWindowInfo(mInstance->winId(), NET::WMGeometry | NET::WMDesktop);
KWindowSystem::setCurrentDesktop(info.desktop());
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment