|
Line 0
Link Here
|
|
|
1 |
################################################# |
| 2 |
# |
| 3 |
# (C) 2012 Golubev Alexander |
| 4 |
# fatzer2 (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.8 ) |
| 13 |
|
| 14 |
|
| 15 |
##### general package setup ##################### |
| 16 |
|
| 17 |
project( tdeutils ) |
| 18 |
|
| 19 |
set( PACKAGE tdeutils ) |
| 20 |
set( VERSION R14 ) |
| 21 |
|
| 22 |
|
| 23 |
##### include essential cmake modules ########### |
| 24 |
|
| 25 |
include( FindPkgConfig ) |
| 26 |
include( CheckIncludeFile ) |
| 27 |
include( CheckLibraryExists ) |
| 28 |
include( CheckSymbolExists ) |
| 29 |
include( CheckFunctionExists ) |
| 30 |
include( CheckCSourceCompiles ) |
| 31 |
include( CheckCXXSourceCompiles ) |
| 32 |
include( CheckTypeSize ) |
| 33 |
|
| 34 |
|
| 35 |
##### include our cmake modules ################# |
| 36 |
|
| 37 |
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) |
| 38 |
include( TDEMacros ) |
| 39 |
|
| 40 |
|
| 41 |
##### setup install paths ####################### |
| 42 |
|
| 43 |
include( TDESetupPaths ) |
| 44 |
tde_setup_paths( ) |
| 45 |
|
| 46 |
|
| 47 |
##### optional stuff ############################ |
| 48 |
|
| 49 |
option( WITH_DPMS "Enable Display Power Management Signaling support" OFF ) |
| 50 |
option( WITH_XSCREENSAVER "Enable xscreensaver support" OFF ) |
| 51 |
option( WITH_ASUS "Enable asus laptop support" OFF ) |
| 52 |
option( WITH_POWERBOOK "Enable powerbook laptop support" OFF ) |
| 53 |
option( WITH_POWERBOOK2 "Enable powerbook2 laptop support" OFF ) |
| 54 |
option( WITH_VAIO "Enable vaio laptop support" OFF ) |
| 55 |
option( WITH_THINKPAD "Enable thinkpad laptop support" OFF ) |
| 56 |
option( WITH_I8K "Enable dell laptop support" OFF ) |
| 57 |
option( WITH_SNMP "Enable SNMP support" OFF ) |
| 58 |
option( WITH_SENSORS "Enable lm_sensors support" OFF ) |
| 59 |
option( WITH_XMMS "Enable xmms support" OFF ) |
| 60 |
option( WITH_KNEWSTUFF "Enable knewstuff support" OFF ) |
| 61 |
|
| 62 |
# option( WITH_NV "Enable nv support" OFF ) |
| 63 |
|
| 64 |
|
| 65 |
##### options comments ########################## |
| 66 |
|
| 67 |
# WITH_DPMS affects klaptopdaemon |
| 68 |
# WITH_DPMS description enables the klaptopdaemon to take into account |
| 69 |
# the state of DPMS X extention to determine is |
| 70 |
# there any user activity. |
| 71 |
# WITH_DPMS requires libXext to build |
| 72 |
# WITH_XSCREENSAVER affects klaptopdaemon |
| 73 |
# WITH_XSCREENSAVER description this makes klaptopdaemon not to register user |
| 74 |
# events when screensaver is disabled. |
| 75 |
# WITH_ASUS affects kmilo |
| 76 |
# WITH_POWERBOOK affects kmilo |
| 77 |
# WITH_POWERBOOK requires pbbuttonsd |
| 78 |
# WITH_POWERBOOK2 affects kmilo |
| 79 |
# WITH_POWERBOOK2 requires pbbuttonsd |
| 80 |
# WITH_VAIO affects kmilo |
| 81 |
# WITH_THINKPAD affects kmilo |
| 82 |
# WITH_I8K affects kmilo ksim |
| 83 |
# WITH_SNMP affects ksim |
| 84 |
# WITH_SENSORS affects ksim |
| 85 |
# WITH_XMMS affects superkaramba |
| 86 |
# WITH_XMMS description enables supercaramba applets to gain |
| 87 |
# information about now playing track etc. |
| 88 |
# WITH_KNEWSTUFF affects superkaramba |
| 89 |
# WITH_KNEWSTUFF description enebles support for downloadable content |
| 90 |
# from kdelooks. |
| 91 |
# FIXME: test if WITH_KNEWSTUFF works in trinity or not |
| 92 |
|
| 93 |
# NOTE: In addition to affects DPMS and XScreenSaver backend options for |
| 94 |
# klaptopdaemon there is some XIdle code but it wasn't compleatly |
| 95 |
# implemented and disabled permanently. |
| 96 |
|
| 97 |
# NOTE: WITH_<laptop> options controls what kamilo modules will be build |
| 98 |
|
| 99 |
# NOTE: WITH_{SENSORS,SNMP,I8K} options for ksim determin which ksim modules |
| 100 |
# will be build. |
| 101 |
|
| 102 |
# NOTE: WITH_XMMS doesn't requires xmms2 palayer to be compiled. |
| 103 |
|
| 104 |
|
| 105 |
##### user requested modules #################### |
| 106 |
|
| 107 |
option( BUILD_ALL "Build all" OFF ) |
| 108 |
option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) |
| 109 |
option( BUILD_ARK "Build ark" ${BUILD_ALL} ) |
| 110 |
option( BUILD_CHARSELECTAPPLET "Build charselectapplet" ${BUILD_ALL} ) |
| 111 |
option( BUILD_KCALC "Build kcalc" ${BUILD_ALL} ) |
| 112 |
option( BUILD_KCHARSELECT "Build kcharselect" ${BUILD_ALL} ) |
| 113 |
option( BUILD_KDELIRC "Build kdelirc" ${BUILD_ALL} ) |
| 114 |
option( BUILD_KDESSH "Build kdessh" ${BUILD_ALL} ) |
| 115 |
option( BUILD_KDF "Build kdf" ${BUILD_ALL} ) |
| 116 |
option( BUILD_KEDIT "Build kedit" ${BUILD_ALL} ) |
| 117 |
option( BUILD_KFLOPPY "Build kfloppy" ${BUILD_ALL} ) |
| 118 |
option( BUILD_KGPG "Build kgpg" ${BUILD_ALL} ) |
| 119 |
option( BUILD_KHEXEDIT "Build khexedit" ${BUILD_ALL} ) |
| 120 |
option( BUILD_KJOTS "Build kjots" ${BUILD_ALL} ) |
| 121 |
option( BUILD_KLAPTOPDAEMON "Build klaptopdaemon" ${BUILD_ALL} ) |
| 122 |
option( BUILD_KMILO "Build kmilo" ${BUILD_ALL} ) |
| 123 |
option( BUILD_KREGEXPEDITOR "Build kregexpeditor" ${BUILD_ALL} ) |
| 124 |
option( BUILD_KSIM "Build ksim" ${BUILD_ALL} ) |
| 125 |
option( BUILD_KTIMER "Build ktimer" ${BUILD_ALL} ) |
| 126 |
option( BUILD_KWALLET "Build kwallet" ${BUILD_ALL} ) |
| 127 |
|
| 128 |
option( BUILD_SUPERKARAMBA "Build superkaramba" ${BUILD_ALL} ) |
| 129 |
|
| 130 |
##### configure checks ########################## |
| 131 |
|
| 132 |
include( ConfigureChecks.cmake ) |
| 133 |
|
| 134 |
|
| 135 |
###### global compiler settings ################# |
| 136 |
|
| 137 |
add_definitions( |
| 138 |
-DHAVE_CONFIG_H |
| 139 |
) |
| 140 |
|
| 141 |
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) |
| 142 |
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) |
| 143 |
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) |
| 144 |
|
| 145 |
|
| 146 |
##### tdeutils directories ###################### |
| 147 |
|
| 148 |
tde_conditional_add_subdirectory( BUILD_ARK ark ) |
| 149 |
tde_conditional_add_subdirectory( BUILD_DOC doc ) |
| 150 |
tde_conditional_add_subdirectory( BUILD_CHARSELECTAPPLET charselectapplet ) |
| 151 |
tde_conditional_add_subdirectory( BUILD_KCALC kcalc ) |
| 152 |
tde_conditional_add_subdirectory( BUILD_KCHARSELECT kcharselect ) |
| 153 |
tde_conditional_add_subdirectory( BUILD_KDELIRC kdelirc ) |
| 154 |
tde_conditional_add_subdirectory( BUILD_KDESSH kdessh ) |
| 155 |
tde_conditional_add_subdirectory( BUILD_KDF kdf ) |
| 156 |
tde_conditional_add_subdirectory( BUILD_KEDIT kedit ) |
| 157 |
tde_conditional_add_subdirectory( BUILD_KFLOPPY kfloppy ) |
| 158 |
tde_conditional_add_subdirectory( BUILD_KGPG kgpg ) |
| 159 |
tde_conditional_add_subdirectory( BUILD_KHEXEDIT khexedit ) |
| 160 |
tde_conditional_add_subdirectory( BUILD_KJOTS kjots ) |
| 161 |
tde_conditional_add_subdirectory( BUILD_KLAPTOPDAEMON klaptopdaemon ) |
| 162 |
tde_conditional_add_subdirectory( BUILD_KMILO kmilo ) |
| 163 |
tde_conditional_add_subdirectory( BUILD_KREGEXPEDITOR kregexpeditor ) |
| 164 |
tde_conditional_add_subdirectory( BUILD_KSIM ksim ) |
| 165 |
tde_conditional_add_subdirectory( BUILD_KTIMER ktimer ) |
| 166 |
tde_conditional_add_subdirectory( BUILD_KWALLET kwallet ) |
| 167 |
tde_conditional_add_subdirectory( BUILD_SUPERKARAMBA superkaramba ) |
| 168 |
|
| 169 |
|
| 170 |
##### write configure files ##################### |
| 171 |
|
| 172 |
configure_file( config.h.cmake config.h @ONLY ) |