Commit 273c2e93 authored by Weixuan Xiao's avatar Weixuan Xiao

Just keep CMakeLists as it was

until Wayland supports macOS or Apple brings back X11
parent af1255ed
......@@ -39,7 +39,7 @@ else()
set(QT_MIN_VERSION "5.10.0")
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Kirigami2)
set(KF5_OPTIONAL_COMPONENTS DocTools)
if(UNIX)
if(UNIX AND NOT APPLE)
set(KF5_OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS} Runner)
endif()
set(QCA_MIN_VERSION "2.1.0")
......
if(UNIX)
if(UNIX AND NOT APPLE)
find_package(KF5 ${KF5_MIN_VERSION} QUIET OPTIONAL_COMPONENTS Wayland)
find_package(LibFakeKey QUIET)
......@@ -18,6 +18,7 @@ endif()
set(HAVE_WINDOWS ${WIN32})
set(HAVE_X11 ${LibFakeKey_FOUND})
set(HAVE_WAYLAND ${KF5Wayland_FOUND})
set(HAVE_MACOS ${APPLE})
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h )
kdeconnect_add_plugin(kdeconnect_mousepad JSON kdeconnect_mousepad.json SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
......@@ -37,3 +38,8 @@ if(HAVE_X11)
target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp)
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
endif()
if (HAVE_MACOS)
target_sources(kdeconnect_mousepad PUBLIC macosremoteinput.mm)
target_link_libraries(kdeconnect_mousepad "-framework CoreGraphics" "-framework ApplicationServices" "-framework Cocoa")
endif()
#cmakedefine01 HAVE_WAYLAND
#cmakedefine01 HAVE_X11
#cmakedefine01 HAVE_WINDOWS
#cmakedefine01 HAVE_MACOS
/**
* Copyright 2019 Weixuan XIAO <veyx.shaw@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MACOSREMOTEINPUT_H
#define MACOSREMOTEINPUT_H
#include "abstractremoteinput.h"
class MacOSRemoteInput
: public AbstractRemoteInput
{
Q_OBJECT
public:
explicit MacOSRemoteInput(QObject* parent);
bool handlePacket(const NetworkPacket& np) override;
bool hasKeyboardSupport() override;
};
#endif
This diff is collapsed.
......@@ -27,6 +27,8 @@
#if HAVE_WINDOWS
#include "windowsremoteinput.h"
#elif HAVE_MACOS
#include "macosremoteinput.h"
#else
#if HAVE_X11
#include "x11remoteinput.h"
......@@ -45,6 +47,8 @@ MousepadPlugin::MousepadPlugin(QObject* parent, const QVariantList& args)
{
#if HAVE_WINDOWS
m_impl = new WindowsRemoteInput(this);
#elif HAVE_MACOS
m_impl = new MacOSRemoteInput(this);
#else
#if HAVE_X11
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
......
Markdown is supported
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