Browse Source

[applications/kpowersave] initial cmake support

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpowersave@1215405 283d02a7-25f6-0310-bc7c-ecb5cbfe19
tags/v3.5.13
samelian 8 years ago
parent
commit
1259472bc0
5 changed files with 198 additions and 0 deletions
  1. 62
    0
      CMakeLists.txt
  2. 70
    0
      ConfigureChecks.cmake
  3. 1
    0
      config.h.cmake
  4. 53
    0
      src/CMakeLists.txt
  5. 12
    0
      src/pics/CMakeLists.txt

+ 62
- 0
CMakeLists.txt View File

@@ -0,0 +1,62 @@
1
+#################################################
2
+#
3
+#  (C) 2010-2011 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+cmake_minimum_required( VERSION 2.6 )
13
+
14
+
15
+##### general package setup #####################
16
+
17
+project( kpowersave )
18
+
19
+
20
+##### include essential cmake modules ###########
21
+
22
+include( CheckCXXSourceCompiles )
23
+include( FindPkgConfig )
24
+
25
+
26
+##### include our cmake modules #################
27
+
28
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
29
+include( TDEMacros )
30
+
31
+
32
+##### setup install paths #######################
33
+
34
+include( TDESetupPaths )
35
+tde_setup_paths( )
36
+
37
+
38
+##### configure checks ##########################
39
+
40
+include( ConfigureChecks.cmake )
41
+
42
+
43
+###### global compiler settings #################
44
+
45
+add_definitions(
46
+  -DHAVE_CONFIG_H
47
+  ${TQT_CFLAGS_OTHER}
48
+)
49
+
50
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
51
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
52
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
53
+
54
+
55
+##### source directories ########################
56
+
57
+add_subdirectory( src )
58
+
59
+
60
+##### write configure files #####################
61
+
62
+configure_file( config.h.cmake config.h @ONLY )

+ 70
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,70 @@
1
+#################################################
2
+#
3
+#  (C) 2010 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+# check for hal
13
+pkg_search_module( HAL hal )
14
+if( HAL_FOUND )
15
+  if( ${HAL_VERSION} VERSION_LESS "0.5.10" )
16
+    tde_message_fatal( "your hal version is too old; at least 0.5.10 is required" )
17
+  else( )
18
+    set( HAVE_HAL_0_5_10 1 )
19
+  endif( )
20
+else( )
21
+  tde_message_fatal( "hal are requested, but not found on your system" )
22
+endif( )
23
+
24
+
25
+# check for Xext
26
+pkg_search_module( XEXT xext )
27
+if( NOT XEXT_FOUND )
28
+  tde_message_fatal( "Xext are required, but not found on your system" )
29
+endif()
30
+
31
+
32
+# check for Xtst
33
+pkg_search_module( XTST xtst )
34
+if( NOT XTST_FOUND )
35
+  tde_message_fatal( "Xtst are required, but not found on your system" )
36
+endif()
37
+
38
+
39
+# check for xscrnsaver
40
+pkg_search_module( XSCRNSAVER xscrnsaver )
41
+if( NOT XSCRNSAVER_FOUND )
42
+  tde_message_fatal( "xscrnsaver are required, but not found on your system" )
43
+endif()
44
+
45
+
46
+# required stuff
47
+find_package( Qt )
48
+find_package( TQt )
49
+find_package( TDE )
50
+
51
+
52
+# check for dbus-1
53
+pkg_search_module( DBUS dbus-1 )
54
+if( NOT DBUS_FOUND )
55
+  tde_message_fatal( "dbus-1 are required, but not found on your system" )
56
+endif( )
57
+
58
+
59
+# check for dbus-qt3 (version 0.7)
60
+tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
61
+set( CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIRS} ${DBUS_INCLUDE_DIRS} )
62
+set( CMAKE_REQUIRED_LIBRARIES ${TQT_LDFLAGS} )
63
+check_cxx_source_compiles("
64
+  #include <dbus/connection.h>
65
+  int main(int, char**) { return 0; } "
66
+  HAVE_DBUS_QT3_07 )
67
+tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
68
+if( NOT HAVE_DBUS_QT3_07 )
69
+  tde_message_fatal( "dbus-qt3 (version 0.7) are required, but not found on your system" )
70
+endif( )

+ 1
- 0
config.h.cmake View File

@@ -0,0 +1 @@
1
+#cmakedefine HAVE_HAL_0_5_10 1

+ 53
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,53 @@
1
+#################################################
2
+#
3
+#  (C) 2010-2011 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+add_subdirectory( pics )
13
+
14
+include_directories(
15
+  ${CMAKE_CURRENT_BINARY_DIR}
16
+  ${CMAKE_BINARY_DIR}
17
+  ${TDE_INCLUDE_DIR}
18
+  ${TQT_INCLUDE_DIRS}
19
+  ${DBUS_INCLUDE_DIRS}
20
+  ${HAL_INCLUDE_DIRS}
21
+)
22
+
23
+link_directories(
24
+  ${TQT_LIBRARY_DIRS}
25
+)
26
+
27
+
28
+##### other data ################################
29
+
30
+tde_install_icons( kpowersave )
31
+install( FILES kpowersave.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
32
+install( FILES kpowersave-autostart.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} )
33
+install( FILES eventsrc DESTINATION ${DATA_INSTALL_DIR}/kpowersave )
34
+install( FILES config/kpowersaverc_default RENAME kpowersaverc DESTINATION ${CONFIG_INSTALL_DIR} )
35
+
36
+
37
+##### kpowersave (kdeinit) ######################
38
+
39
+tde_add_kdeinit_executable( kpowersave AUTOMOC
40
+  SOURCES
41
+    dummy.cpp autodimm.cpp autosuspend.cpp
42
+    blacklistedit_Dialog.ui blacklisteditdialog.cpp
43
+    configure_Dialog.ui configuredialog.cpp countdown_Dialog.ui
44
+    countdowndialog.cpp dbusHAL.cpp detailed_Dialog.ui
45
+    detaileddialog.cpp hardware.cpp hardware_battery.cpp
46
+    hardware_batteryCollection.cpp hardware_cpu.cpp
47
+    inactivity.cpp info_Dialog.ui infodialog.cpp kpowersave.cpp
48
+    kpowersave.skel log_viewer.ui logviewer.cpp main.cpp
49
+    screen.cpp settings.cpp suspenddialog.cpp suspend_Dialog.ui
50
+  LINK
51
+    dbus-qt-1 kio-shared ${DBUS_LIBRARIES} ${HAL_LIBRARIES}
52
+    ${XEXT_LIBRARIES} ${XTST_LIBRARIES} ${XSCRNSAVER_LIBRARIES}
53
+)

+ 12
- 0
src/pics/CMakeLists.txt View File

@@ -0,0 +1,12 @@
1
+#################################################
2
+#
3
+#  (C) 2010-2011 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/kpowersave/icons )

Loading…
Cancel
Save