Fixed support for tests in cmake.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 5ea733c60c)
r14.0.x
Michele Calgaro 6 years ago committed by Slávek Banko
parent 2ec4f38c78
commit 2d2d8bba9f
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -27,7 +27,7 @@ include( CheckIncludeFile )
include( CheckFunctionExists ) include( CheckFunctionExists )
include( CheckLibraryExists ) include( CheckLibraryExists )
include( CheckSymbolExists ) include( CheckSymbolExists )
enable_testing( )
#### include our cmake modules ################## #### include our cmake modules ##################
@ -73,6 +73,8 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined"
add_subdirectory( lib ) add_subdirectory( lib )
add_subdirectory( kpilot ) add_subdirectory( kpilot )
add_subdirectory( conduits ) add_subdirectory( conduits )
add_subdirectory( tests )
tde_conditional_add_subdirectory( BUILD_DOC doc ) tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )

@ -1,51 +1,79 @@
link_directories(${CMAKE_BINARY_DIR}/lib ${CMAKE_CURRENT_BINARY_DIR}) #################################################
include_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_BINARY_DIR}/lib) #
# (C) 2019 Michele Calgaro
# michele (DOT) calgaro (AT) yahoo (DOT) it
#
# Improvements and feedbacks are welcome
#
# This file is released under GPL >= 3
#
#################################################
include_directories(
${TQT_INCLUDE_DIRS}
${TDE_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/lib
${CMAKE_BINARY_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
link_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/lib
)
# Tests don't need to go into toplevel/bin, they are fine in the current dir. # Tests don't need to go into toplevel/bin, they are fine in the current dir.
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
set(testconstants_SRCS testconstants.cc) tde_add_check_executable( testconstants
trinity_add_executable(testconstants ${testconstants_SRCS}) SOURCES testconstants.cc
target_link_libraries(testconstants kpilot ${QT_LIBRARIES}) LINK kpilot-shared ${TQT_LIBRARIES}
add_test(testconstants ${EXECUTABLE_OUTPUT_PATH}/testconstants) TEST
)
set(testcategories_SRCS testcategories.cc) tde_add_check_executable( testcategories
trinity_add_executable(testcategories ${testcategories_SRCS}) SOURCES testcategories.cc
target_link_libraries(testcategories kpilot ${QT_LIBRARIES}) LINK kpilot-shared ${TQT_LIBRARIES}
add_test(testcategories ${EXECUTABLE_OUTPUT_PATH}/testcategories) TEST
)
set(testaddresses_SRCS testaddress.cc) tde_add_check_executable( testaddresses
trinity_add_executable(testaddresses ${testaddresses_SRCS}) SOURCES testaddress.cc
target_link_libraries(testaddresses kpilot ${QT_LIBRARIES}) LINK kpilot-shared ${TQT_LIBRARIES}
add_test(testaddresses ${EXECUTABLE_OUTPUT_PATH}/testaddresses) TEST
)
set(testdatebook_SRCS testdatebook.cc) tde_add_check_executable( testdatebook
trinity_add_executable(testdatebook ${testdatebook_SRCS}) SOURCES testdatebook.cc
target_link_libraries(testdatebook kpilot ${QT_LIBRARIES}) LINK kpilot-shared ${TQT_LIBRARIES}
add_test(testdatebook ${EXECUTABLE_OUTPUT_PATH}/testdatebook) TEST
)
set(testidmapper_SRCS testidmapper.cc) tde_add_check_executable( importaddresses
trinity_add_executable(testidmapper ${testidmapper_SRCS}) SOURCES importaddresses.cc
target_link_libraries(testidmapper kpilot ${QT_LIBRARIES}) LINK kpilot-shared tdeabc-shared tdeabc_file-shared ${TQT_LIBRARIES}
add_test(testidmapper ${EXECUTABLE_OUTPUT_PATH}/testidmapper) )
add_test(importaddresses ${EXECUTABLE_OUTPUT_PATH}/importaddresses --data-dir "${CMAKE_CURRENT_BINARY_DIR}" --address-file "${CMAKE_CURRENT_SOURCE_DIR}/data/AddressDB.pdb")
if (HAVE_CALENDARLOCAL_H) if (HAVE_CALENDARLOCAL_H)
set(importdatebook_SRCS importdatebook.cc) tde_add_check_executable( importdatebook
set(exportdatebook_SRCS exportdatebook.cc) SOURCES importdatebook.cc
set(mergecalendars_SRCS mergecalendars.cc) LINK kpilot-shared kcal-shared ${TQT_LIBRARIES}
trinity_add_executable(importdatebook ${importdatebook_SRCS}) TEST
trinity_add_executable(exportdatebook ${exportdatebook_SRCS}) )
trinity_add_executable(mergecalendars ${mergecalendars_SRCS})
target_link_libraries(importdatebook kpilot ${QT_LIBRARIES} kcal)
target_link_libraries(exportdatebook kpilot ${QT_LIBRARIES} kcal)
target_link_libraries(mergecalendars ${QT_LIBRARIES} kcal)
add_test(importdatebook ${EXECUTABLE_OUTPUT_PATH}/importdatebook)
add_test(exportdatebook ${EXECUTABLE_OUTPUT_PATH}/exportdatebook)
add_test(mergecalendars ${EXECUTABLE_OUTPUT_PATH}/mergecalendars)
endif (HAVE_CALENDARLOCAL_H)
set(importaddresses_SRCS importaddresses.cc) tde_add_check_executable( exportdatebook
trinity_add_executable(importaddresses ${importaddresses_SRCS}) SOURCES exportdatebook.cc
target_link_libraries(importaddresses kpilot ${QT_LIBRARIES} tdeabc tdeabc_file) LINK kpilot-shared kcal-shared ${TQT_LIBRARIES}
add_test(importaddresses ${EXECUTABLE_OUTPUT_PATH}/importaddresses) TEST
)
tde_add_check_executable( mergecalendars
SOURCES mergecalendars.cc
LINK kpilot-shared kcal-shared ${TQT_LIBRARIES}
TEST
)
endif (HAVE_CALENDARLOCAL_H)

@ -59,8 +59,7 @@ int main(int argc, char **argv)
TDECmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
TDECmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
// TDEApplication app( false, false ); TDEApplication app( false, false );
TDEApplication app;
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();

Loading…
Cancel
Save