comparison ui/tests/CMakeLists.txt @ 310:f758460ca437

Merged
author Sascha Wilde <wilde@intevation.de>
date Fri, 04 Apr 2014 09:54:19 +0200
parents 2fd69803d219
children ad28f6b60e6b
comparison
equal deleted inserted replaced
309:fa37384b86b6 310:f758460ca437
1 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) 1 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
2 2
3 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../common) 3 include_directories(${CMAKE_CURRENT_BINARY_DIR}
4 ${CMAKE_SOURCE_DIR}/ui
5 ${CMAKE_SOURCE_DIR}/common
6 ${CMAKE_SOURCE_DIR}/cinst)
4 7
5 find_package(Qt5Test) 8 find_package(Qt5Test)
6 include_directories(${Qt5Test_INCLUDE_DIRS}) 9 include_directories(${Qt5Test_INCLUDE_DIRS})
7 find_program(HIAWATHA_EXECUTABLE hiawatha) 10 find_program(HIAWATHA_EXECUTABLE hiawatha)
8 11
13 endif() 16 endif()
14 17
15 macro(add_m13_test _source _additional_sources) 18 macro(add_m13_test _source _additional_sources)
16 set(_test ${_source}) 19 set(_test ${_source})
17 get_filename_component(_name ${_source} NAME_WE) 20 get_filename_component(_name ${_source} NAME_WE)
18 set(_test_sources_with_resources ${_test} ${_additional_sources}) 21 set(_test_sources_with_resources ${_test} "${_additional_sources};${CMAKE_CURRENT_SOURCE_DIR}/common.cpp")
19 qt5_add_resources(_test_sources_with_resources 22 qt5_add_resources(_test_sources_with_resources
20 ${CMAKE_CURRENT_SOURCE_DIR}/data/testdata.qrc) 23 ${CMAKE_CURRENT_SOURCE_DIR}/data/testdata.qrc)
21 add_executable(${_name} ${_test_sources_with_resources}) 24 add_executable(${_name} ${_test_sources_with_resources})
22 add_test(m13-${_name} ${_name}) 25 add_test(m13-${_name} ${_name})
23 target_link_libraries(${_name} Qt5::Test Qt5::Widgets 26 target_link_libraries(${_name} Qt5::Test Qt5::Widgets
27 endmacro() 30 endmacro()
28 31
29 # Add the current source dir to the definition 32 # Add the current source dir to the definition
30 # so that it can be used in file names in the tests. 33 # so that it can be used in file names in the tests.
31 add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") 34 add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
32 add_m13_test(certlistparsertest.cpp "${CERTIFICATELIST_SOURCES};${CMAKE_CURRENT_SOURCE_DIR}/common.cpp") 35 add_m13_test(certlistparsertest.cpp "${CERTIFICATELIST_SOURCES}")
33 36
34 # Downloader 37 # Downloader
35 if (HIAWATHA_EXECUTABLE) 38 if (HIAWATHA_EXECUTABLE)
36 set(DOWNLOADER_SOURCES_WITH_RESOURCES ${DOWNLOADER_SOURCES}) 39 set(DOWNLOADER_SOURCES_WITH_RESOURCES ${DOWNLOADER_SOURCES})
37 qt5_add_resources(DOWNLOADER_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES}) 40 qt5_add_resources(DOWNLOADER_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES})
38 add_m13_test(downloadertest.cpp "${DOWNLOADER_SOURCES_WITH_RESOURCES};${CMAKE_CURRENT_SOURCE_DIR}/common.cpp") 41 add_m13_test(downloadertest.cpp "${DOWNLOADER_SOURCES_WITH_RESOURCES}")
39 endif() 42 endif()
40 43
41 # Cinstprocess 44 # Cinstprocess
42 add_m13_test(cinstprocesstest.cpp "${CERTIFICATELIST_SOURCES}") 45 add_m13_test(cinstprocesstest.cpp "${CERTIFICATELIST_SOURCES}")
46 add_dependencies(cinstprocesstest cinst)
43 add_m13_test(commontest.cpp "") 47 add_m13_test(commontest.cpp "")
44 48
45 if (WIN32) 49 if (WIN32)
46 add_m13_test(windowsstoretest.cpp "${CERTIFICATELIST_SOURCES};${CMAKE_SOURCE_DIR}/cinst/windowsstore.c") 50 add_m13_test(windowsstoretest.cpp "${CERTIFICATELIST_SOURCES};${CMAKE_SOURCE_DIR}/cinst/windowsstore.c")
47 endif (WIN32) 51 endif (WIN32)
48 52
53 if (NSS_FOUND)
54 include_directories(${NSS_INCLUDE_DIRS})
55 add_m13_test(nsstest.cpp "${CERTIFICATELIST_SOURCES};${CMAKE_SOURCE_DIR}/cinst/nssstore_linux.c")
56 target_link_libraries(nsstest ${NSS_LIBRARIES})
57 add_dependencies(nsstest mozilla)
58 endif()
59
49 #add_m13_test(${CMAKE_SOURCE_DIR}/ui/main.cpp "${M13UI_SOURCES}") 60 #add_m13_test(${CMAKE_SOURCE_DIR}/ui/main.cpp "${M13UI_SOURCES}")
50 61

http://wald.intevation.org/projects/trustbridge/