@@ -5,9 +5,18 @@ enable_language(Fortran)
55
66set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS" )
77
8+ if (WIN32 )
9+ FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.ps1
10+ "$ErrorActionPreference = \" Stop\"\n "
11+ "Get-Content $args[1] | & $args[0]\n "
12+ )
13+ set (test_helper powershell -ExecutionPolicy Bypass "${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.ps1" )
14+ else ()
815FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh
916"$1 < $2\n "
1017)
18+ set (test_helper sh "${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh" )
19+ endif ()
1120
1221foreach (float_type ${FLOAT_TYPES} )
1322 string (SUBSTRING ${float_type} 0 1 float_char_upper)
@@ -21,7 +30,7 @@ foreach(float_type ${FLOAT_TYPES})
2130 c_${float_char}blas1.c )
2231 target_link_libraries (x${float_char}cblat1 ${OpenBLAS_LIBNAME} )
2332 add_test (NAME "x${float_char} cblat1"
24- COMMAND " ${CMAKE_CURRENT_BINARY_DIR} / x${float_char} cblat1" )
33+ COMMAND $< TARGET_FILE : x ${float_char} cblat1 > )
2534
2635 #level2
2736 add_executable (x${float_char}cblat2
@@ -33,7 +42,7 @@ foreach(float_type ${FLOAT_TYPES})
3342 constant.c )
3443 target_link_libraries (x${float_char}cblat2 ${OpenBLAS_LIBNAME} )
3544 add_test (NAME "x${float_char} cblat2"
36- COMMAND sh " ${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh" " ${CMAKE_CURRENT_BINARY_DIR} / x${float_char} cblat2" "${PROJECT_SOURCE_DIR} /ctest/${float_char} in2" )
45+ COMMAND ${test_helper} $< TARGET_FILE : x ${float_char} cblat2 > "${PROJECT_SOURCE_DIR} /ctest/${float_char} in2" )
3746
3847 #level3
3948 add_executable (x${float_char}cblat3
@@ -45,6 +54,6 @@ foreach(float_type ${FLOAT_TYPES})
4554 constant.c )
4655 target_link_libraries (x${float_char}cblat3 ${OpenBLAS_LIBNAME} )
4756 add_test (NAME "x${float_char} cblat3"
48- COMMAND sh " ${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh" " ${CMAKE_CURRENT_BINARY_DIR} / x${float_char} cblat3" "${PROJECT_SOURCE_DIR} /ctest/${float_char} in3" )
57+ COMMAND ${test_helper} $< TARGET_FILE : x ${float_char} cblat3 > "${PROJECT_SOURCE_DIR} /ctest/${float_char} in3" )
4958
5059endforeach ()
0 commit comments