da52da2d6e21a7799d76ca7d7ae9b4f85e0a5cdd
[buliscores] / qjson / tests / parser / CMakeLists.txt
1 ##### Probably don't want to edit below this line #####
2
3 SET( QT_USE_QTTEST TRUE )
4
5 # Use it
6 INCLUDE( ${QT_USE_FILE} )
7
8 INCLUDE(AddFileDependencies)
9
10 # Include the library include directories, and the current build directory (moc)
11 INCLUDE_DIRECTORIES(
12   ../../src
13   ${CMAKE_CURRENT_BINARY_DIR}
14 )
15
16 SET( UNIT_TESTS
17   testparser
18 )
19
20 # Build the tests
21 FOREACH(test ${UNIT_TESTS})
22   MESSAGE(STATUS "Building ${test}")
23   QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp)
24   ADD_EXECUTABLE(
25     ${test}
26     ${test}.cpp
27   )
28
29   ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE})
30   TARGET_LINK_LIBRARIES(
31     ${test}
32     ${QT_LIBRARIES}
33     qjson
34   )
35   if (QJSON_TEST_OUTPUT STREQUAL "xml")
36     # produce XML output
37     add_test( ${test} ${test} -xml -o ${test}.tml )
38   else (QJSON_TEST_OUTPUT STREQUAL "xml")
39     add_test( ${test} ${test} )
40   endif (QJSON_TEST_OUTPUT STREQUAL "xml")
41 ENDFOREACH()