Browse Source

Remove option -DNO_KF5_AUTH and make KF5 Auth a required package.

Malte Veerman 10 years ago
parent
commit
8146438810
4 changed files with 40 additions and 31 deletions
  1. 17 19
      CMakeLists.txt
  2. 0 1
      README.md
  3. 17 10
      fancontrol-gui/CMakeLists.txt
  4. 6 1
      helper/CMakeLists.txt

+ 17 - 19
CMakeLists.txt

@@ -4,12 +4,14 @@ project(fancontroller)
 
 include(FeatureSummary)
 
-option(NO_KF5_AUTH "Compile without KF5-Auth. Program will be unable to execute commands as root!")
 option(NO_SYSTEMD "Compile without Systemd support. Reduces functionality significantly!")
 
 #Find Qt5
 find_package(Qt5 COMPONENTS Widgets Qml Quick REQUIRED)
-include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${Qt5Quick_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${Qt5Widgets_INCLUDE_DIRS}
+                    ${Qt5Qml_INCLUDE_DIRS}
+                    ${Qt5Quick_INCLUDE_DIRS}
+                    ${CMAKE_CURRENT_BINARY_DIR})
 add_definitions(${Qt5Widgets_DEFINITIONS})
 
 set(CMAKE_AUTOMOC ON)
@@ -18,39 +20,35 @@ set(CMAKE_AUTOMOC ON)
 cmake_policy(SET CMP0037 OLD)
 
 #Find KF5
-find_package(ECM)
+find_package(ECM REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
-find_package(KF5Auth)
+find_package(KF5 COMPONENTS Auth REQUIRED)
 find_package(Qt5DBus)
 
 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
-#KF5_Auth
-if(ECM_FOUND AND KF5Auth_FOUND AND NOT NO_KF5_AUTH)
-    message(STATUS "Compiling with KF5_AUTH")
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings)
 
-    include(KDEInstallDirs)
-    include(KDECMakeSettings)
-    include(KDECompilerSettings)
-
-    add_subdirectory(helper)
-else(ECM_FOUND AND KF5Auth_FOUND AND NOT NO_KF5_AUTH)
-    message(STATUS "Compiling without KF5_AUTH")
-    set(NO_KF5_AUTH true)
-endif(ECM_FOUND AND KF5Auth_FOUND AND NOT NO_KF5_AUTH)
+add_subdirectory(helper)
 
 #Systemd
 find_library(SYSTEMD_FOUND NAMES systemd)
 
-if(NOT NO_SYSTEMD AND SYSTEMD_FOUND)
+if(NOT NO_SYSTEMD AND SYSTEMD_FOUND AND Qt5DBus_FOUND)
+
     message(STATUS "Compiling for Systemd")
 
     include_directories(${Qt5DBus_INCLUDE_DIRS})
-else(NOT NO_SYSTEMD AND SYSTEMD_FOUND)
+
+else(NOT NO_SYSTEMD AND SYSTEMD_FOUND AND Qt5DBus_FOUND)
+
     message(STATUS "Compiling without Systemd")
     set(NO_SYSTEMD true)
-endif(NOT NO_SYSTEMD AND SYSTEMD_FOUND)
+
+endif(NOT NO_SYSTEMD AND SYSTEMD_FOUND AND Qt5DBus_FOUND)
 
 add_subdirectory(share)
 add_subdirectory(fancontrol-gui)

+ 0 - 1
README.md

@@ -1,6 +1,5 @@
 # fancontrol-gui
 GUI for Fancontrol. 
 It uses the KAuth module of the KDE Frameworks 5 to write the generated config file. 
-If you don't want to compile with KF5 set the option -DNO_KF5_KAUTH=true. 
 Furthermore it communicates with systemd via dbus to control the fancontrol service. 
 If you want to compile without systemd support set the option -DNO_SYSTEMD=true.

+ 17 - 10
fancontrol-gui/CMakeLists.txt

@@ -1,18 +1,25 @@
-set(Fancontrol-GUI_SRCS src/main.cpp src/loader.cpp src/hwmon.cpp src/sensors.cpp)
+set(Fancontrol-GUI_SRCS src/main.cpp
+                        src/loader.cpp
+                        src/hwmon.cpp
+                        src/sensors.cpp)
 
-set(LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Qml_Libraries} ${Qt5Quick_LIBRARIES})
-
-if(NO_KF5_AUTH)
-    add_definitions(-DNO_KF5_AUTH)
-else(NO_KF5_AUTH)
-    set(LIBRARIES ${LIBRARIES} KF5::Auth)
-endif(NO_KF5_AUTH)
+set(LIBRARIES ${Qt5Widgets_LIBRARIES}
+              ${Qt5Qml_Libraries}
+              ${Qt5Quick_LIBRARIES}
+              KF5::Auth)
 
 if(NO_SYSTEMD)
+
     add_definitions(-DNO_SYSTEMD)
+
 else(NO_SYSTEMD)
-    set(Fancontrol-GUI_SRCS ${Fancontrol-GUI_SRCS} src/systemdcommunicator.cpp)
-    set(LIBRARIES ${LIBRARIES} Qt5::DBus)
+
+    set(Fancontrol-GUI_SRCS ${Fancontrol-GUI_SRCS}
+                            src/systemdcommunicator.cpp)
+
+    set(LIBRARIES ${LIBRARIES}
+                  Qt5::DBus)
+
 endif(NO_SYSTEMD)
 
 add_executable(fancontrol-gui ${Fancontrol-GUI_SRCS} ${RESOURCES})

+ 6 - 1
helper/CMakeLists.txt

@@ -4,9 +4,14 @@ kauth_install_actions(fancontrol.gui.helper fancontrol-gui.actions)
 set(LIBRARIES KF5::Auth)
 
 if(NO_SYSTEMD)
+
     add_definitions(-DNO_SYSTEMD)
+
 else(NO_SYSTEMD)
-    set(LIBRARIES ${LIBRARIES} Qt5::DBus)
+
+    set(LIBRARIES ${LIBRARIES}
+                  Qt5::DBus)
+
 endif(NO_SYSTEMD)
 
 add_executable(fancontrol-gui-helper src/helper.cpp)