|
|
|
#################################################
|
|
|
|
#
|
|
|
|
# (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}/kdecore
|
|
|
|
${CMAKE_SOURCE_DIR}/kdecore
|
|
|
|
${CMAKE_BINARY_DIR}/kabc
|
|
|
|
${CMAKE_SOURCE_DIR}/kabc
|
|
|
|
${CMAKE_SOURCE_DIR}/kabc/vcard/include
|
|
|
|
${CMAKE_SOURCE_DIR}/kabc/vcard/include/generated
|
|
|
|
${CMAKE_SOURCE_DIR}/kio/kio
|
|
|
|
${CMAKE_SOURCE_DIR}/dcop
|
|
|
|
)
|
|
|
|
|
|
|
|
link_directories(
|
|
|
|
${TQT_LIBRARY_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
set( TDEABC_TESTS_LINK
|
|
|
|
${TQT_LIBRARIES}
|
|
|
|
DCOP-shared
|
|
|
|
kdecore-shared
|
|
|
|
kdeui-shared
|
|
|
|
kdefx-shared
|
|
|
|
kio-shared
|
|
|
|
ktexteditor-shared
|
|
|
|
kabc-shared
|
|
|
|
)
|
|
|
|
|
|
|
|
##### headers ###################################
|
|
|
|
|
|
|
|
install( FILES
|
|
|
|
vcard.h vcardline.h vcardparser.h
|
|
|
|
DESTINATION ${INCLUDE_INSTALL_DIR}/kabc )
|
|
|
|
|
|
|
|
|
|
|
|
##### 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}/kabc/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}/kabc/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}/kabc/vcardparser/tests ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|