summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 5e05d645c8d4e4273821fb9fb5b073aa0b821cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
project (KolabUtils)

cmake_minimum_required(VERSION 2.6)

if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7)
    cmake_policy(SET CMP0013 NEW)
endif()

# Versioning
# x.y.z scheme
# Development versions are only x.y
#
# i.e.
# 0.1 (0.1 development version towards 0.1.0)
# 0.1.0 (first release)
# 0.1.1 (patch release for 0.1.0)
# 0.2 (0.2 development version towards 0.2.0)
set(Kolabutils_VERSION_MAJOR 3)
set(Kolabutils_VERSION_MINOR 1)
# Enable the full x.y.z version only for release versions
# set(Kolabutils_VERSION_PATCH 0)
# set(Kolabutils_VERSION ${Kolabutils_VERSION_MAJOR}.${Kolabutils_VERSION_MINOR}.${Kolabutils_VERSION_PATCH} )
set(Kolabutils_VERSION ${Kolabutils_VERSION_MAJOR}.${Kolabutils_VERSION_MINOR} )
set(Kolabutils_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Kolabutils_VERSION})

option( USE_LIBCALENDARING "Use libcalendaring" FALSE )
option(BUILD_GOOGLESUPPORT "Build modues that require libkgoogle" FALSE)

set(CMAKE_MODULE_PATH ${KolabUtils_SOURCE_DIR}/cmake/modules)

set(BIN_INSTALL_DIR bin CACHE STRING "Where to install binaries to")
set(LIB_INSTALL_DIR lib CACHE STRING "Where to install libraries to")

find_package(Qt4 4.6.0 REQUIRED)
find_package(Libkolab 0.5.0 REQUIRED)
find_package(Libkolabxml 1.0 REQUIRED)
if (USE_LIBCALENDARING)
    find_package(Libcalendaring)
    set( KDE_INCLUDES ${Libcalendaring_INCLUDE_DIRS} )
    set( KDE_LIBRARIES ${Libcalendaring_LIBRARIES} )
    find_library(KDE_KIMAPTEST NAMES calendaring-kimaptest)
    message("${Libcalendaring_INCLUDE_DIRS} ${Libcalendaring_LIBRARIES}")
else()
    find_package(KDE4 4.8 REQUIRED)
    find_package(KdepimLibs 4.9.50 REQUIRED)
    set( KDE_INCLUDES ${KDEPIMLIBS_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR})
    set( KDE_LIBRARIES
        ${KDE4_KDECORE_LIBRARY}
        ${KDEPIMLIBS_KCALCORE_LIBS}
        ${KDEPIMLIBS_KABC_LIBS}
        ${KDEPIMLIBS_KMIME_LIBS}
        ${KDEPIMLIBS_KIMAP_LIBS}
        )
     find_library(KDE_KIMAPTEST NAMES kimaptest)
endif()

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -g" )
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG")

configure_file(kolabutils-version.h.cmake "${CMAKE_BINARY_DIR}/kolabutils-version.h" @ONLY)

include_directories(./  lib ${QT_INCLUDES} ${KDE_INCLUDES} ${Libkolab_INCLUDES} ${Libkolabxml_INCLUDES})

set(COMMON_DEPENDENCIES
    ${Libkolab_LIBRARIES}
    ${Libkolabxml_LIBRARIES}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTNETWORK_LIBRARY}
    ${QT_QTXML_LIBRARY}
    ${QT_GUI_LIBRARY}
    ${KDE_LIBRARIES}
)

enable_testing()

add_subdirectory(lib)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(fbdaemon)
add_subdirectory(migrationutility)
add_subdirectory(upgradetool)

########## Upgradetool

QT4_WRAP_CPP(SRC_MOC
    upgradetool/imapupgradejob.h
    upgradetool/kolabformatupgradejob.h
)

add_executable(kolab-formatupgrade ${UPGRADE_SRCS} ${SRC_MOC} ${JOBS_SRCS})
target_link_libraries(kolab-formatupgrade ${COMMON_DEPENDENCIES} kolabutils)

install(TARGETS kolab-formatupgrade
    RUNTIME DESTINATION ${BIN_INSTALL_DIR}
    LIBRARY DESTINATION ${LIB_INSTALL_DIR}
    ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)