summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 19ec430506e6bed3bfa24548d4374701f8789d39 (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
project (KolabUtilsFormat)

cmake_minimum_required(VERSION 2.6)

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

option( USE_LIBCALENDARING "Use libcalendaring" FALSE )

set(CMAKE_MODULE_PATH ${KolabUtilsFormat_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.4.0 REQUIRED)
find_package(Libkolabxml 0.7 REQUIRED) #We should probably add the Libkolabxml_INCLUDES to Libkolab_INCLUDES if we have libkolabxml headers in the installed libkolab headers
if (USE_LIBCALENDARING)
    find_package(Libcalendaring)
    set( KDE_INCLUDES ${Libcalendaring_INCLUDE_DIRS} )
    set( KDE_LIBRARIES ${Libcalendaring_LIBRARIES} )
    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}
        )
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")

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

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

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}
)