summaryrefslogtreecommitdiff
path: root/kimap/CMakeLists.txt
blob: b9ef7c44a684fb04acd00227992a45893e1cc811 (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
project(kimap)
add_subdirectory( tests )

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

# In CMake >= 2.8.6, FindBoost.cmake tries to find BoostConfig.cmake which is
# not compatible with CMake's FindBoost. Disable this function.
set(Boost_NO_BOOST_CMAKE TRUE)

set(Boost_MINIMUM_VERSION 1.34.0)
find_package(Boost ${Boost_MINIMUM_VERSION} COMPONENTS graph)
# set_package_properties(Boost PROPERTIES
#                        URL "http://www.boost.org"
#                        DESCRIPTION "The Boost C++ Libraries (incl. the boost-graph library)"
#                        TYPE REQUIRED
#                        PURPOSE "Required by core components"
# )

find_package(Sasl2)
# set_package_properties(Sasl2 PROPERTIES
#                         URL "http://asg.web.cmu.edu/sasl/sasl-library.html"
#                         DESCRIPTION "The Cyrus SASL API implentation"
#                         TYPE REQUIRED
#                         PURPOSE "Login authentication for IMAP and Sieve"
# )
find_package(Qt4 4.6.0 REQUIRED)

include_directories(${QT_INCLUDES})

#include(GenerateExportHeader)


include_directories( ../kdecore ../ ${CMAKE_CURRENT_BINARY_DIR})




###########################################################
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5327 )

# add_subdirectory( tests )

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")

set(kimap_LIB_SRCS
   acl.cpp
   imapset.cpp
   imapstreamparser.cpp
   job.cpp
   appendjob.cpp
   capabilitiesjob.cpp
   fetchjob.cpp
   idlejob.cpp
   listjob.cpp
   loginjob.cpp
   logoutjob.cpp
   namespacejob.cpp
   rfccodecs.cpp
   selectjob.cpp
   session.cpp
   sessionlogger.cpp
   sessionthread.cpp
   closejob.cpp
   expungejob.cpp
   deletejob.cpp
   createjob.cpp
   subscribejob.cpp
   unsubscribejob.cpp
   renamejob.cpp
   storejob.cpp
   copyjob.cpp
   searchjob.cpp
   acljobbase.cpp
   setacljob.cpp
   getacljob.cpp
   deleteacljob.cpp
   myrightsjob.cpp
   listrightsjob.cpp
   quotajobbase.cpp
   setquotajob.cpp
   getquotajob.cpp
   getquotarootjob.cpp
   metadatajobbase.cpp
   setmetadatajob.cpp
   getmetadatajob.cpp
)

# MOCFILES

# foreach (SOURCEFILE ${kimap_LIB_SRCS})
#     string (REGEX REPLACE "^(.+)\\.cpp" "\\1.h" HEADERFILE ${SOURCEFILE})
#     QT4_WRAP_CPP(MOC ${HEADERFILE})
#     set(MOCFILES "${MOCFILES} ${MOC}")
# endforeach()
# 
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
# 
# message("${kimap_LIB_HEADERS}")


QT4_AUTOMOC("${kimap_LIB_SRCS}")
# QT4_WRAP_CPP(MOC ${kimap_LIB_HEADERS})
# message("${MOC}")
# QT4_GENERATE_MOC(fetchjob.h moc_fetchjob.cpp)
# QT4_GENERATE_MOC(idlejob.h moc_idlejob.cpp)
# QT4_GENERATE_MOC(listjob.h moc_listjob.cpp)
# QT4_GENERATE_MOC(loginjob.h moc_loginjob.cpp)
# QT4_GENERATE_MOC(session.h moc_session.cpp)
# QT4_GENERATE_MOC(session_p.h moc_session_p.cpp)

# QT4_WRAP_CPP(MOCFILES
#     job.h
#     fetchjob.h
#     idlejob.h
#     listjob.h
#     loginjob.h
#     session.h
#     session_p.h
#     sessionthread_p.h
#     namespacejob.h
#     deletejob.h
#     getquotajob.h
#     getmetadatajob.h
#     listrightsjob.h
#     metadatajobbase.h
# )
# add_custom_target(dummy ALL DEPENDS ${MOCFILES})
# 
# QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/deleteacljob.h ${CMAKE_CURRENT_BINARY_DIR}/deleteacljob.moc)
# message("${CMAKE_CURRENT_SOURCE_DIR}/deleteacljob.h")
# message("${CMAKE_CURRENT_BINARY_DIR}/deleteacljob.moc")
# QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/closejob.h ${CMAKE_CURRENT_BINARY_DIR}/closejob.moc)
# QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/getquotajob.h ${CMAKE_CURRENT_BINARY_DIR}/getquotajob.moc)
# QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/expungejob.h ${CMAKE_CURRENT_BINARY_DIR}/expungejob.moc)
# QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/selectjob.h ${CMAKE_CURRENT_BINARY_DIR}/selectjob.moc)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_library(calendaring-kimap ${LIBRARY_TYPE} ${kimap_LIB_SRCS} )

target_link_libraries(calendaring-kimap calendaring-kdecore ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY} calendaring-kmime  ${SASL2_LIBRARIES})

include_directories( ${SASL2_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )

set_target_properties(calendaring-kimap PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS calendaring-kimap EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})

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

install( FILES kimap_export.h acl.h imapset.h job.h appendjob.h capabilitiesjob.h fetchjob.h idlejob.h listjob.h loginjob.h logoutjob.h namespacejob.h rfccodecs.h
 selectjob.h closejob.h expungejob.h deletejob.h createjob.h subscribejob.h unsubscribejob.h renamejob.h
 session.h sessionuiproxy.h storejob.h copyjob.h searchjob.h acljobbase.h setacljob.h getacljob.h deleteacljob.h
 myrightsjob.h listrightsjob.h quotajobbase.h setquotajob.h getquotajob.h getquotarootjob.h metadatajobbase.h setmetadatajob.h getmetadatajob.h
 DESTINATION ${INCLUDE_INSTALL_DIR}/kimap  COMPONENT Devel)