1include_directories(${CUNIT_INCLUDE_DIRS}) 2 3set(TEST_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}) 4set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TEST_DATA_DIR}) 5 6file(GLOB datafiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.ref" "*.data") 7foreach(file ${datafiles}) 8 configure_file("${file}" "${file}" COPYONLY) 9endforeach() 10 11foreach(TN IN ITEMS iwkv_test1 12 iwkv_test2 13 iwkv_test3 14 iwkv_test4 15 iwkv_test5 16 iwkv_test6 17 iwkv_test7 18 iwkv_test8 19 iwkv_test9 20 iwkv_test10 21 ) 22 add_executable(${TN} ${TN}.c) 23 target_link_libraries(${TN} iowow_s ${CUNIT_LIBRARIES}) 24 set_target_properties(${TN} PROPERTIES 25 COMPILE_FLAGS "-DIW_STATIC") 26 add_test(NAME ${TN} WORKING_DIRECTORY ${TEST_DATA_DIR} 27 COMMAND ${TEST_TOOL_CMD} $<TARGET_FILE:${TN}>) 28endforeach() 29 30 31