You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. enable_language(Fortran)
  4. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS")
  5. if(WIN32)
  6. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.ps1
  7. "$ErrorActionPreference = \"Stop\"\n"
  8. "Get-Content $args[1] | & $args[0]\n"
  9. )
  10. set(test_helper powershell -ExecutionPolicy Bypass "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.ps1")
  11. else()
  12. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh
  13. "$1 < $2\n"
  14. )
  15. set(test_helper sh "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh")
  16. endif()
  17. foreach(float_type ${FLOAT_TYPES})
  18. string(SUBSTRING ${float_type} 0 1 float_char_upper)
  19. string(TOLOWER ${float_char_upper} float_char)
  20. #level1
  21. add_executable(x${float_char}cblat1
  22. c_${float_char}blat1.f
  23. c_${float_char}blas1.c)
  24. target_link_libraries(x${float_char}cblat1 ${OpenBLAS_LIBNAME})
  25. add_test(NAME "x${float_char}cblat1"
  26. COMMAND $<TARGET_FILE:x${float_char}cblat1>)
  27. #level2
  28. add_executable(x${float_char}cblat2
  29. c_${float_char}blat2.f
  30. c_${float_char}blas2.c
  31. c_${float_char}2chke.c
  32. auxiliary.c
  33. c_xerbla.c
  34. constant.c)
  35. target_link_libraries(x${float_char}cblat2 ${OpenBLAS_LIBNAME})
  36. add_test(NAME "x${float_char}cblat2"
  37. COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat2> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in2")
  38. #level3
  39. add_executable(x${float_char}cblat3
  40. c_${float_char}blat3.f
  41. c_${float_char}blas3.c
  42. c_${float_char}3chke.c
  43. auxiliary.c
  44. c_xerbla.c
  45. constant.c)
  46. target_link_libraries(x${float_char}cblat3 ${OpenBLAS_LIBNAME})
  47. add_test(NAME "x${float_char}cblat3"
  48. COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat3> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in3")
  49. endforeach()