Fix KDEInstallDirs deprecation warnings
authorChih-Hsuan Yen <yen@chyen.cc>
Fri, 28 Dec 2018 13:55:45 +0000 (21:55 +0800)
committerChih-Hsuan Yen <yen@chyen.cc>
Fri, 28 Dec 2018 13:55:45 +0000 (21:55 +0800)
Get rid of a bunch of such warnings from configuring the Dolphin plugin:

CMake Deprecation Warning at /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:345 (message):
  BIN_INSTALL_DIR is deprecated, use KDE_INSTALL_BINDIR instead.
Call Stack (most recent call first):
  /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:433 (_define_relative)
  shell_integration/dolphin/CMakeLists.txt:23 (include)

Modified from https://github.com/owncloud/client/pull/6922

Original author: Dominik Schmidt <dev@dominik-schmidt.de>

shell_integration/dolphin/CMakeLists.txt

index 688ccbb14fd09a6aa8a99a1492d6bd683e5a0ef1..41cde7afb232b678f960cfe7170a2ed1735297ea 100644 (file)
@@ -20,7 +20,12 @@ set_package_properties(DolphinVcs PROPERTIES
     PURPOSE "Provides plugin interfaces for Dolphin."
 )
 
+set(KDE_INSTALL_DIRS_NO_DEPRECATED TRUE)
 include(KDEInstallDirs)
+# Before KF5 5.54, kcoreaddons_add_plugin uses deprecated VAR PLUGIN_INSTALL_DIR
+# when that is fixed and you want to remove this workaround,
+# you need to _require_ the new enough kcoreaddons
+set(PLUGIN_INSTALL_DIR "${KDE_INSTALL_PLUGINDIR}")
 include(KDECMakeSettings)
 include(KDECompilerSettings)
 include(ECMMarkNonGuiExecutable)