From 77720103a0c98bacb6c5e870d8365607e09c90cd Mon Sep 17 00:00:00 2001 From: barracuda156 Date: Sat, 23 Dec 2023 20:48:46 +0800 Subject: [PATCH] macOS: unbreak build with Qt4 diff --git src/qmplay2/CMakeLists.txt src/qmplay2/CMakeLists.txt index c41de094..d29382cd 100644 --- src/qmplay2/CMakeLists.txt +++ src/qmplay2/CMakeLists.txt @@ -131,10 +131,12 @@ if(USE_FREEDESKTOP_NOTIFICATIONS) endif() add_definitions(-DNOTIFIES_FREEDESKTOP) elseif(APPLE) + if(USE_QT5) list(APPEND QMPLAY2_HDR headers/NotifiesMacOS.hpp) list(APPEND QMPLAY2_SRC NotifiesMacOS.mm) find_package(Qt5MacExtras REQUIRED) add_definitions(-DNOTIFIES_MACOS) + endif() endif() set(QMPLAY2_RESOURCES diff --git src/qmplay2/QMPlay2Core.cpp src/qmplay2/QMPlay2Core.cpp index dd3f2a38..264bf055 100644 --- src/qmplay2/QMPlay2Core.cpp +++ src/qmplay2/QMPlay2Core.cpp @@ -36,7 +36,7 @@ #if defined Q_OS_WIN #include #include -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC && (QT_VERSION > QT_VERSION_CHECK(5, 0, 0)) #include #endif @@ -179,7 +179,7 @@ void QMPlay2CoreClass::init(bool loadModules, bool modulesInSubdirs, const QStri { #if defined(Q_OS_WIN) settingsDir = QFileInfo(QSettings(QSettings::IniFormat, QSettings::UserScope, QString()).fileName()).absolutePath() + "/QMPlay2/"; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MAC) && (QT_VERSION > QT_VERSION_CHECK(5, 0, 0)) settingsDir = Functions::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation).value(0, settingsDir)); #else settingsDir = QDir::homePath() + "/.qmplay2/";