瀏覽代碼

always install helper files in /usr and /etc regardless of CMAKE_INSTALL_PREFIX.

Malte Veerman 9 年之前
父節點
當前提交
4f5b205235
共有 6 個文件被更改,包括 7 次插入32 次删除
  1. 2 2
      CMakeLists.txt
  2. 0 1
      fancontrol-gui/src/main.cpp
  3. 3 4
      helper/CMakeLists.txt
  4. 0 23
      helper/CreateSystemSymlinks.cmake
  5. 1 1
      kcm/CMakeLists.txt
  6. 1 1
      lib/src/loader.cpp

+ 2 - 2
CMakeLists.txt

@@ -92,12 +92,12 @@ endif(BUILD_GUI)
 
 
 #Build the KCM
-if(BUILD_KCM AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
+if(BUILD_KCM)
 
     message(STATUS "Build the KCM")
     add_subdirectory(kcm)
 
-endif(BUILD_KCM AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
+endif(BUILD_KCM)
 
 
 #install the shared parts

+ 0 - 1
fancontrol-gui/src/main.cpp

@@ -21,7 +21,6 @@
 #include <QtQml/QQmlApplicationEngine>
 #include <QtQml/QQmlContext>
 #include <QtCore/QFileInfo>
-#include <QDebug>
 
 #include <KDeclarative/KDeclarative>
 #include <KI18n/KLocalizedString>

+ 3 - 4
helper/CMakeLists.txt

@@ -14,9 +14,8 @@ add_executable(fancontrol-gui-helper src/helper.cpp)
 target_link_libraries(fancontrol-gui-helper ${LIBRARIES})
 install(TARGETS fancontrol-gui-helper DESTINATION ${KAUTH_HELPER_INSTALL_ABSOLUTE_DIR})
 
+set(SYSCONF_INSTALL_DIR "/etc")
+set(DBUS_SYSTEM_SERVICES_INSTALL_DIR "/usr/share/dbus-1/system-services")
+
 kauth_install_helper_files(fancontrol-gui-helper fancontrol.gui.helper root)
 kauth_install_actions(fancontrol.gui.helper fancontrol_gui.actions)
-
-if(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
-    install(SCRIPT CreateSystemSymlinks.cmake)
-endif(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")

+ 0 - 23
helper/CreateSystemSymlinks.cmake

@@ -1,23 +0,0 @@
-
-set(helper_conf_file "etc/dbus-1/system.d/fancontrol.gui.helper.conf")
-set(helper_service_file "share/dbus-1/system-services/fancontrol.gui.helper.service")
-set(helper_conf_file_destination "/${helper_conf_file}")
-set(helper_service_file_destination "/usr/${helper_service_file}")
-
-
-execute_process(COMMAND ln -sf ${CMAKE_INSTALL_PREFIX}/${helper_conf_file} ${helper_conf_file_destination} RESULT_VARIABLE result OUTPUT_VARIABLE output)
-message(STATUS "Creating symlink: ${helper_conf_file_destination} -> ${CMAKE_INSTALL_PREFIX}/${helper_conf_file}")
-
-if(${result})
-    message(WARNING "Creation of symlink ${helper_conf_file_destination} -> ${CMAKE_INSTALL_PREFIX}/${helper_conf_file} failed:")
-    message(WARNING "${output}")
-endif(${result})
-
-
-execute_process(COMMAND ln -sf ${CMAKE_INSTALL_PREFIX}/${helper_service_file} ${helper_service_file_destination} RESULT_VARIABLE result OUTPUT_VARIABLE output)
-message(STATUS "Creating symlink: ${helper_service_file_destination} -> ${CMAKE_INSTALL_PREFIX}/${helper_service_file}")
-
-if(${result})
-    message(WARNING "Creation of symlink ${helper_service_file_destination} -> ${CMAKE_INSTALL_PREFIX}/${helper_service_file} failed:")
-    message(WARNING "${output}")
-endif(${result})

+ 1 - 1
kcm/CMakeLists.txt

@@ -8,7 +8,7 @@ add_library(kcm_fancontrol MODULE src/fancontrolkcm.cpp)
                                   
 target_link_libraries(kcm_fancontrol ${LIBRARIES})
 
-install(TARGETS kcm_fancontrol DESTINATION "${LIB_INSTALL_DIR}/qt/plugins/kcms")
+install(TARGETS kcm_fancontrol DESTINATION ${CMAKE_INSTALL_PLUGINDIR})
 install(FILES kcm_fancontrol.desktop DESTINATION ${SERVICES_INSTALL_DIR})
 
 kcoreaddons_desktop_to_json(kcm_fancontrol "kcm_fancontrol.desktop")

+ 1 - 1
lib/src/loader.cpp

@@ -227,7 +227,7 @@ bool Loader::load(const QUrl &url)
     QString fileName;
     if (url.isEmpty())
     {
-        qDebug() << "Given empty url. Fallback to " << m_configUrl;
+        qDebug() << "Given empty url. Fallback to" << m_configUrl;
         fileName = m_configUrl.toLocalFile();
     }
     else if (url.isValid())