summaryrefslogtreecommitdiff
path: root/kabc/CMakeLists.txt
blob: 936133003bf9aa231e60fca7a723d14d21439cf9 (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

project(kabc)

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_directories( ${KDE4_KIO_INCLUDES} )

add_definitions(${QDBUS_DEFINITIONS} -DKDE_DEFAULT_DEBUG_AREA=5700)
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions( -DWANT_DEPRECATED_KABC_API )

# these apply also for all subdirs
include_directories(
 ${CMAKE_CURRENT_SOURCE_DIR}
 ${CMAKE_CURRENT_BINARY_DIR}
 ${CMAKE_CURRENT_SOURCE_DIR}/vcardparser
)

# kabc/vcardparser/Makefile.am: vcards

set(vcards_STAT_SRCS
  vcardparser/vcard.cpp
  vcardparser/vcardline.cpp
  vcardparser/vcardparser.cpp
)

# add_subdirectory( vcardparser )
# add_subdirectory( tests )
#add_subdirectory( scripts )
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts)



add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/field.cpp ${CMAKE_CURRENT_BINARY_DIR}/addressee.h ${CMAKE_CURRENT_BINARY_DIR}/addressee.cpp
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts
   COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/makeaddressee
   DEPENDS
   scripts/makeaddressee
   scripts/addressee.src.cpp
   scripts/addressee.src.h
   scripts/entrylist
   scripts/field.src.cpp
   )


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

set(kabc_LIB_SRCS
   address.cpp
   ${CMAKE_CURRENT_BINARY_DIR}/addressee.cpp
   ${CMAKE_CURRENT_BINARY_DIR}/addressee.h
   ${CMAKE_CURRENT_BINARY_DIR}/field.cpp
   contactgroup.cpp
   contactgrouptool.cpp
   errorhandler.cpp
   geo.cpp
   key.cpp
#    ldapdn.cpp
#    ldif.cpp
   phonenumber.cpp
   picture.cpp
   plugin.cpp
   secrecy.cpp
   sound.cpp
   timezone.cpp
#    ldifconverter.cpp
   addresseelist.cpp
   vcardconverter.cpp
   vcardtool.cpp
   addresseehelper.cpp
#    lock.cpp
#    locknull.cpp
   sortmode.cpp
#    vcarddrag.cpp
   ${vcards_STAT_SRCS}
)

QT4_AUTOMOC("${kabc_LIB_SRCS}")

# if (NOT WINCE)
#   set(kabc_LIB_SRCS
#     ${kabc_LIB_SRCS}
#    #disabled due to no QTreeWidget
#    emailselectdialog.cpp
#   )
# endif()

add_library(calendaring-kabc ${LIBRARY_TYPE} ${kabc_LIB_SRCS})

target_link_libraries(calendaring-kabc ${KDE4_KDEUI_LIBS} ${KDE4_KDECORE_LIBS})
target_link_libraries(calendaring-kabc LINK_INTERFACE_LIBRARIES ${KDE4_KDEUI_LIBS})

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

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

# install( FILES countrytransl.map  DESTINATION  ${DATA_INSTALL_DIR}/kabc )
install( FILES
   kabc_export.h
   address.h
   ${CMAKE_CURRENT_BINARY_DIR}/addressee.h
   addresseelist.h
   contactgroup.h
   contactgrouptool.h
#    emailselectdialog.h
   errorhandler.h
   field.h
   geo.h
   key.h
#    ldifconverter.h
#    lock.h
#    locknull.h
   phonenumber.h
   picture.h
   plugin.h
   secrecy.h
   sortmode.h
   sound.h
   timezone.h
   vcardconverter.h
#    vcarddrag.h
   DESTINATION ${INCLUDE_INSTALL_DIR}/kabc COMPONENT Devel
)