summaryrefslogtreecommitdiff
path: root/kcalcore/CMakeLists.txt
blob: f127f9370ce77ede786fa38663da0a3c04fe8681 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
project(kcalcore)


set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
cmake_minimum_required(VERSION 2.6)

# only available from cmake-2.8.0
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7)
    cmake_policy(SET CMP0012 NEW)
endif()

# only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND
    ${CMAKE_PATCH_VERSION} GREATER 3)
    cmake_policy(SET CMP0017 NEW)
endif()



find_package(Qt4 4.6.0 REQUIRED)

include_directories(${QT_INCLUDES})

#include(GenerateExportHeader)

############### Build Options ###############

# The following macros can be defined to alter how KCalCore is built.
# For example, cmake -DKCALCORE_FOR_MEEGO=true

# KCALCORE_FOR_MEEGO - builds KCalCore with some special features for the MeeGo platform.
# option(KCALCORE_FOR_MEEGO "Build KCalCore especially for the MeeGo." FALSE)

# KCALCORE_FOR_SYMBIAN - builds KCalCore with some special features for the Symbian platform.
# option(KCALCORE_FOR_SYMBIAN "Build KCalCore especially for the Symbian." FALSE)

# add C++ macro definitions for options passed to CMake
# if(KCALCORE_FOR_MEEGO)
#   add_definitions(-DKCALCORE_FOR_MEEGO)
# endif()
# if(KCALCORE_FOR_SYMBIAN)
#   add_definitions(-DKCALCORE_FOR_SYMBIAN)
# endif()

############### Find packages ###############
# FIXME KDE5PORT needed: kdatetime which belongs to kdecore
# find_package(kcoreaddons REQUIRED)
# include_directories(${kcoreaddons_INCLUDE_DIR} ${kcoreaddons_INCLUDE_DIR}/KDE)


find_package(Libical "0.42" REQUIRED)


include_directories( ../kdecore )




###########################################################

add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5810)

include(ConfigureChecks.cmake)
configure_file(config-kcalcore.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcalcore.h)

if(KDE4_BUILD_TESTS)
  add_definitions(-DCOMPILING_TESTS)
endif()

include_directories(
  ${LIBICAL_INCLUDE_DIRS}
  ${LIBICAL_INCLUDE_DIRS}/libical
  ${CMAKE_CURRENT_SOURCE_DIR}/versit
  ${KDE4_INCLUDE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
)

########### next target ###############

set(libversit_SRCS
  ${CMAKE_CURRENT_SOURCE_DIR}/versit/vcc.c
  ${CMAKE_CURRENT_SOURCE_DIR}/versit/vobject.c
)

set(kcalcore_LIB_SRCS ${libversit_SRCS}
  alarm.cpp
  attachment.cpp
  attendee.cpp
  calendar.cpp
  calfilter.cpp
  calformat.cpp
  calstorage.cpp
  compat.cpp
  customproperties.cpp
  duration.cpp
  event.cpp
  exceptions.cpp
  filestorage.cpp
  freebusy.cpp
  freebusycache.cpp
  freebusyurlstore.cpp
  freebusyperiod.cpp
  icalformat.cpp
  icalformat_p.cpp
  icaltimezones.cpp
  incidence.cpp
  incidencebase.cpp
  journal.cpp
  memorycalendar.cpp
  period.cpp
  person.cpp
  recurrence.cpp
  recurrencerule.cpp
  schedulemessage.cpp
  sorting.cpp
  todo.cpp
  vcalformat.cpp
  visitor.cpp
)

QT4_AUTOMOC("${kcalcore_LIB_SRCS}")

add_library(calendaring-kcalcore ${LIBRARY_TYPE} ${kcalcore_LIB_SRCS})
# generate_export_header(kcalcore)

#${KDE4_KDECORE_LIBRARY}
target_link_libraries(calendaring-kcalcore calendaring-kdecore ${QT_QTGUI_LIBRARY} ${LIBICAL_LIBRARIES})

if(HAVE_UUID_LIBRARY)
  target_link_libraries(calendaring-kcalcore uuid)
endif()

# set(libcalendaring-kcalcore ${libcalendaring-kcalcore} PARENT_SCOPE)
# message("${libcalendaring-kcalcore}")
set_target_properties(calendaring-kcalcore PROPERTIES
    VERSION ${ECM_VERSION_STRING}
    SOVERSION ${ECM_SOVERSION}
)

install(TARGETS calendaring-kcalcore EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})

########### next target ###############

#add_subdirectory(tests)

########### install files ###############

install(FILES
  kcalcore_export.h
  alarm.h
  attachment.h
  attendee.h
  calendar.h
  calfilter.h
  calformat.h
  calstorage.h
  compat.h
  customproperties.h
  duration.h
  event.h
  exceptions.h
  filestorage.h
  freebusy.h
  freebusycache.h
  freebusyperiod.h
  freebusyurlstore.h
  icalformat.h
  icaltimezones.h
  incidence.h
  incidencebase.h
  journal.h
  memorycalendar.h
  period.h
  person.h
  recurrence.h
  recurrencerule.h
  schedulemessage.h
  sortablelist.h
  sorting.h
  supertrait.h
  todo.h
  vcalformat.h
  visitor.h
  DESTINATION ${INCLUDE_INSTALL_DIR}/kcalcore COMPONENT Devel)