File: BuildTests.cmake

package info (click to toggle)
kdb 3.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,276 kB
  • sloc: cpp: 38,360; yacc: 940; python: 779; sh: 711; ansic: 440; lex: 367; xml: 182; sql: 51; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
remove_definitions(-DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII)
add_definitions(-DFILES_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
add_definitions(-DFILES_OUTPUT_DIR="${CMAKE_CURRENT_BINARY_DIR}")

macro(build_test __test_name)
    set(_test_name Test${__test_name})
    set(${_test_name}_SRCS ${_test_name}.cpp)
    set(${_test_name}_MOC_SRCS ${_test_name}.h)
    qt_wrap_cpp(${_test_name} ${_test_name}_SRCS ${${_test_name}_MOC_SRCS})
    add_executable(${_test_name} ${${_test_name}_SRCS})
    target_link_libraries(${_test_name} KDb ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY})
if (BUILD_TEST_COVERAGE)
    target_link_libraries(${_test_name} gcov)
endif ()
    add_test(${_test_name} ${CMAKE_CURRENT_BINARY_DIR}/${_test_name})
endmacro()