summaryrefslogtreecommitdiffstats
path: root/tdeabc/vcardparser/CMakeLists.txt
blob: 632c4fb9f6c681a66a1c898d3707ea70605d6a87 (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
#################################################
#
#  (C) 2010 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

include_directories(
  ${TQT_INCLUDE_DIRS}
  ${CMAKE_BINARY_DIR}
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_BINARY_DIR}/tdecore
  ${CMAKE_SOURCE_DIR}/tdecore
  ${CMAKE_BINARY_DIR}/tdeabc
  ${CMAKE_SOURCE_DIR}/tdeabc
  ${CMAKE_SOURCE_DIR}/tdeabc/vcard/include
  ${CMAKE_SOURCE_DIR}/tdeabc/vcard/include/generated
  ${CMAKE_SOURCE_DIR}/tdeio/tdeio
  ${CMAKE_SOURCE_DIR}/dcop
)

link_directories(
  ${TQT_LIBRARY_DIRS}
)

set( TDEABC_TESTS_LINK
  ${TQT_LIBRARIES}
  DCOP-shared
  tdecore-shared
  tdeui-shared
  tdefx-shared
  tdeio-shared
  tdetexteditor-shared
  tdeabc-shared
)

##### headers ###################################

install( FILES
    vcard.h vcardline.h vcardparser.h
  DESTINATION ${INCLUDE_INSTALL_DIR}/tdeabc )


##### vcards ####################################

set( target vcards )

set( ${target}_SRCS
  vcard.cpp vcardline.cpp vcardparser.cpp
)

tde_add_library( ${target} STATIC_PIC
  SOURCES ${${target}_SRCS}
)


##### test programs ##############################

tde_add_executable( testread
  SOURCES testread.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

tde_add_executable( testread2
  SOURCES testread2.cpp testutils.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

tde_add_executable( testwrite
  SOURCES testwrite.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

tde_add_executable( testwrite2
  SOURCES testwrite2.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

tde_add_executable( testvcardformat
  SOURCES testvcardformat.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

tde_add_executable( testvcardformatimpl
  SOURCES testvcardformatimpl.cpp AUTOMOC
  LINK ${TDEABC_TESTS_LINK}
)

add_custom_target(test ALL echo "performing tests on vcardparser"
   COMMAND bash ./test.sh
   DEPENDS testing
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_custom_target(testing ALL echo "creating test infrastructure"
   DEPENDS testvcardformatimpl testvcardformat testwrite2 testwrite testread2 testread
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_custom_command(
  TARGET testing PRE_BUILD
  COMMAND test
  ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/test.sh || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/test.sh ${CMAKE_CURRENT_BINARY_DIR}
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_custom_command(
  TARGET testing PRE_BUILD
  COMMAND test
  ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/checkvcard.pl || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/checkvcard.pl ${CMAKE_CURRENT_BINARY_DIR}
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_custom_command(
  TARGET testing PRE_BUILD
  COMMAND test
  ARGS -d ${CMAKE_CURRENT_BINARY_DIR}/tests || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/tests ${CMAKE_CURRENT_BINARY_DIR}
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)