--- /dev/null
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,7 +36,7 @@
+ add_definitions(-DMAGICK7)
+ endif()
+ find_package(PkgConfig REQUIRED)
+- pkg_check_modules(MAGICK REQUIRED ImageMagick++)
++ pkg_check_modules(MAGICK REQUIRED Magick++)
+ # ffmpeg
+ if(ENABLE_FFMPEG)
+ pkg_check_modules(AVDEVICE REQUIRED libavdevice)
+@@ -66,7 +66,7 @@
+ find_package(Qt5Concurrent REQUIRED)
+
+ # inotify
+-if("${CMAKE_SYSTEM}" NOT MATCHES "Linux")
++if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(NOTIFY REQUIRED libinotify)
+ endif()
+@@ -123,7 +123,7 @@
+ ${PROJECT_VERSION_MAJOR}
+ )
+ if(ENABLE_MAGICK OR ENABLE_MAGICK7)
+- target_compile_definitions(QtFM PRIVATE ${MAGICK_CFLAGS_OTHER})
++ target_compile_options(QtFM PRIVATE ${MAGICK_CFLAGS_OTHER})
+ target_link_libraries(QtFM ${MAGICK_LIBRARIES})
+ if(ENABLE_FFMPEG)
+ target_include_directories(QtFM
+@@ -161,7 +161,7 @@
+ if(ENABLE_DBUS)
+ target_link_libraries(QtFM Qt5::DBus QtFMBus)
+ endif()
+-if("${CMAKE_SYSTEM}" NOT MATCHES "Linux")
++if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ target_link_libraries(QtFM ${NOTIFY_LIBRARIES})
+ endif()
+ if(APPLE)
+@@ -192,7 +192,7 @@
+ if(ENABLE_DBUS)
+ target_link_libraries(${PROJECT_NAME} Qt5::DBus)
+ endif()
+-if("${CMAKE_SYSTEM}" NOT MATCHES "Linux")
++if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ target_link_libraries(${PROJECT_NAME} ${NOTIFY_LIBRARIES})
+ endif()
+ if(APPLE)
--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit git-r3 xdg-utils cmake-utils
+
+DESCRIPTION="A small, lightweight file manager for desktops based on pure Qt"
+HOMEPAGE="https://qtfm.eu/"
+EGIT_REPO_URI="https://github.com/rodlie/qtfm/"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS=""
+IUSE="+dbus ffmpeg imagemagick"
+
+RDEPEND="
+ dev-qt/qtconcurrent:5
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtwidgets:5
+ sys-apps/file
+ dbus? ( dev-qt/qtdbus:5 )
+ ffmpeg? ( virtual/ffmpeg )
+ imagemagick? ( >=media-gfx/imagemagick-7:= )
+"
+DEPEND="
+ ${RDEPEND}
+ app-arch/unzip
+ dev-qt/linguist-tools:5
+"
+PATCHES=(
+ "${FILESDIR}"/${PN}-99999-cmake.patch
+)
+
+src_configure() {
+ mycmakeargs=(
+ -DENABLE_DBUS="$(usex dbus)"
+ -DENABLE_FFMPEG="$(usex ffmpeg)"
+ -DENABLE_MAGICK7="$(usex imagemagick)"
+ )
+ cmake-utils_src_configure
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+}