| 1 |
if (NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) |
| 2 |
message("Boost Unit Test Framework not found. Not compiling tests") |
| 3 |
return() |
| 4 |
endif () |
| 5 |
|
| 6 |
file(READ ${CMAKE_SOURCE_DIR}/schema/ismrmrd_example.xml ismrmrd_example) |
| 7 |
string(REPLACE "\"" "\\\"" ismrmrd_example ${ismrmrd_example}) |
| 8 |
string(REPLACE "\n" "\\\n" ismrmrd_example ${ismrmrd_example}) |
| 9 |
|
| 10 |
file(READ ${CMAKE_SOURCE_DIR}/schema/ismrmrd_example_extended.xml ismrmrd_example_extended) |
| 11 |
string(REPLACE "\"" "\\\"" ismrmrd_example_extended ${ismrmrd_example_extended}) |
| 12 |
string(REPLACE "\n" "\\\n" ismrmrd_example_extended ${ismrmrd_example_extended}) |
| 13 |
|
| 14 |
configure_file(embedded_xml.h.in embedded_xml.h) |
| 15 |
|
| 16 |
include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include ${Boost_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 17 |
|
| 18 |
set(TEST_SOURCES |
| 19 |
test_main.cpp |
| 20 |
test_acquisitions.cpp |
| 21 |
test_images.cpp |
| 22 |
test_ndarray.cpp |
| 23 |
test_flags.cpp |
| 24 |
test_channels.cpp |
| 25 |
test_xml_header.cpp |
| 26 |
test_quaternions.cpp |
| 27 |
test_serialization.cpp) |
| 28 |
|
| 29 |
if (USE_HDF5_DATASET_SUPPORT) |
| 30 |
set(TEST_SOURCES ${TEST_SOURCES} |
| 31 |
test_dataset.cpp |
| 32 |
test_end_to_end.cpp) |
| 33 |
|
| 34 |
add_executable(benchmark_dataset benchmark_dataset.cpp) |
| 35 |
target_link_libraries(benchmark_dataset ismrmrd ${Boost_LIBRARIES}) |
| 36 |
set_property(TARGET benchmark_dataset PROPERTY CXX_STANDARD 11) |
| 37 |
endif() |
| 38 |
|
| 39 |
add_executable(test_ismrmrd ${TEST_SOURCES}) |
| 40 |
target_link_libraries(test_ismrmrd ismrmrd ${Boost_LIBRARIES}) |
| 41 |
add_test(NAME check COMMAND test_ismrmrd ) |