@@ -5,9 +5,18 @@ enable_language(Fortran)
5
5
6
6
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS" )
7
7
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 ()
8
15
FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh
9
16
"$1 < $2\n "
10
17
)
18
+ set (test_helper sh "${CMAKE_CURRENT_BINARY_DIR} /test_cblas_helper.sh" )
19
+ endif ()
11
20
12
21
foreach (float_type ${FLOAT_TYPES} )
13
22
string (SUBSTRING ${float_type} 0 1 float_char_upper )
@@ -18,7 +27,7 @@ foreach(float_type ${FLOAT_TYPES})
18
27
c_${float_char}blas1.c )
19
28
target_link_libraries (x${float_char}cblat1 ${OpenBLAS_LIBNAME} )
20
29
add_test (NAME "x${float_char} cblat1"
21
- COMMAND " ${CMAKE_CURRENT_BINARY_DIR} / x${float_char} cblat1" )
30
+ COMMAND $< TARGET_FILE: x${float_char} cblat1> )
22
31
23
32
#level2
24
33
add_executable (x${float_char}cblat2
@@ -30,7 +39,7 @@ foreach(float_type ${FLOAT_TYPES})
30
39
constant.c )
31
40
target_link_libraries (x${float_char}cblat2 ${OpenBLAS_LIBNAME} )
32
41
add_test (NAME "x${float_char} cblat2"
33
- 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" )
42
+ COMMAND ${test_helper} $< TARGET_FILE: x${float_char} cblat2> "${PROJECT_SOURCE_DIR} /ctest/${float_char} in2" )
34
43
35
44
#level3
36
45
add_executable (x${float_char}cblat3
@@ -42,6 +51,6 @@ foreach(float_type ${FLOAT_TYPES})
42
51
constant.c )
43
52
target_link_libraries (x${float_char}cblat3 ${OpenBLAS_LIBNAME} )
44
53
add_test (NAME "x${float_char} cblat3"
45
- 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" )
54
+ COMMAND ${test_helper} $< TARGET_FILE: x${float_char} cblat3> "${PROJECT_SOURCE_DIR} /ctest/${float_char} in3" )
46
55
47
56
endforeach ()
0 commit comments