| 1 |
project(konversation) |
| 2 |
|
| 3 |
#paranoid? |
| 4 |
cmake_minimum_required(VERSION 2.6.2) |
| 5 |
|
| 6 |
set(KDE_MIN_VERSION "4.3.0") |
| 7 |
#atm this gets us FindQt4 and FindX11 (provided that the default cmake FindQt4 doesn't get used) |
| 8 |
find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED) |
| 9 |
find_package(KdepimLibs REQUIRED) |
| 10 |
include(KDE4Defaults) |
| 11 |
include(MacroLibrary) |
| 12 |
include(CheckIncludeFile) |
| 13 |
include(CMakeDependentOption) |
| 14 |
|
| 15 |
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) |
| 16 |
|
| 17 |
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) |
| 18 |
if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debugfull) |
| 19 |
add_definitions (-DQT_STRICT_ITERATORS) |
| 20 |
endif() |
| 21 |
|
| 22 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES}) |
| 23 |
|
| 24 |
#check for KDE greater than 4.3.80 (used for KStatusNotifier) |
| 25 |
macro_ensure_version("4.3.80" ${KDE_VERSION} HAVEKDE4_4) |
| 26 |
|
| 27 |
#check for KDE greater than 4.4.3 (usable version of KIdleTime) |
| 28 |
macro_ensure_version("4.4.3" ${KDE_VERSION} HAVEKDE4_4_3) |
| 29 |
|
| 30 |
if (HAVEKDE4_4_3) |
| 31 |
option(USE_KIDLETIME "Use KIdleTime for user inactivity detection." ON) |
| 32 |
endif (HAVEKDE4_4_3) |
| 33 |
|
| 34 |
if (HAVEKDE4_4_3 AND USE_KIDLETIME) |
| 35 |
macro_bool_to_01(USE_KIDLETIME HAVE_KIDLETIME) |
| 36 |
#only log the status of the feature if the user wants to build with KIdleTime support |
| 37 |
macro_log_feature(HAVE_KIDLETIME "KIdleTime" "KDE Idle Time" "http://www.kde.org/" FALSE "" "KIdleTime based user inactivity detection for the auto-away functionality") |
| 38 |
endif (HAVEKDE4_4_3 AND USE_KIDLETIME) |
| 39 |
|
| 40 |
#looks like the original test is from Kopete, their port doesn't use Xext so neither shall ours |
| 41 |
if (Q_WS_X11 AND NOT HAVE_KIDLETIME) |
| 42 |
macro_bool_to_01(X11_Xscreensaver_FOUND HAVE_XSCREENSAVER) |
| 43 |
macro_log_feature(HAVE_XSCREENSAVER "libXss" "X ScreenSaver Library" "http://www.x.org/" FALSE "" "Screensaver detection support for the auto-away functionality") |
| 44 |
|
| 45 |
macro_bool_to_01(X11_FOUND HAVE_X11) |
| 46 |
macro_log_feature(HAVE_X11 "libx11" "X Window System Client Library" "http://www.x.org/" FALSE "" "User inactivity detection support for the auto-away functionality") |
| 47 |
|
| 48 |
macro_bool_to_01(X11_Xutil_FOUND HAVE_XUTIL) |
| 49 |
macro_log_feature(HAVE_XUTIL "X11 Xutil.h header" "X11 Xutil header" "http://www.x.org/" FALSE "" "User inactivity detection support for the auto-away functionality") |
| 50 |
endif (Q_WS_X11 AND NOT HAVE_KIDLETIME) |
| 51 |
|
| 52 |
macro_optional_find_package(QCA2) |
| 53 |
macro_bool_to_01(QCA2_FOUND HAVE_QCA2) |
| 54 |
macro_log_feature(QCA2_FOUND "QCA" "Qt Cryptographic Architecture" "http://delta.affinix.com/qca" FALSE "2.0.0" "Required for using encryption in IRC") |
| 55 |
|
| 56 |
#define the value for HAVE_KSTATUSNOTIFIERITEM |
| 57 |
macro_bool_to_01(HAVEKDE4_4 HAVE_KSTATUSNOTIFIERITEM) |
| 58 |
|
| 59 |
check_include_file("stropts.h" HAVE_STROPTS_H) |
| 60 |
check_include_file("byteswap.h" HAVE_BYTESWAP_H) |
| 61 |
check_include_file("sys/endian.h" HAVE_SYS_ENDIAN_H) |
| 62 |
|
| 63 |
configure_file(config-konversation.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-konversation.h ) |
| 64 |
|
| 65 |
add_subdirectory(src) |
| 66 |
add_subdirectory(data) |
| 67 |
|
| 68 |
macro_display_feature_log() |