/CBLAS/testing/CMakeLists.txt

https://bitbucket.org/iricpt/lapack · CMake · 104 lines · 75 code · 21 blank · 8 comment · 5 complexity · d75b2122332a0994816695bff6e37de5 MD5 · raw file

  1. #######################################################################
  2. # This CMakeLists.txt creates the test programs for the CBLAS routines.
  3. #
  4. #######################################################################
  5. macro(add_cblas_test output input target)
  6. set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
  7. set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${output}")
  8. set(testName "${target}")
  9. if(EXISTS "${TEST_INPUT}")
  10. add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
  11. -DTEST=$<TARGET_FILE:${target}>
  12. -DINPUT=${TEST_INPUT}
  13. -DOUTPUT=${TEST_OUTPUT}
  14. -DINTDIR=${CMAKE_CFG_INTDIR}
  15. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  16. else()
  17. add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
  18. -DTEST=$<TARGET_FILE:${target}>
  19. -DOUTPUT=${TEST_OUTPUT}
  20. -DINTDIR=${CMAKE_CFG_INTDIR}
  21. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  22. endif()
  23. endmacro()
  24. # Object files for single precision real
  25. set(STESTL1O c_sblas1.c)
  26. set(STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
  27. set(STESTL3O c_sblas3.c c_s3chke.c auxiliary.c c_xerbla.c)
  28. # Object files for double precision real
  29. set(DTESTL1O c_dblas1.c)
  30. set(DTESTL2O c_dblas2.c c_d2chke.c auxiliary.c c_xerbla.c)
  31. set(DTESTL3O c_dblas3.c c_d3chke.c auxiliary.c c_xerbla.c)
  32. # Object files for single precision complex
  33. set(CTESTL1O c_cblat1.f c_cblas1.c)
  34. set(CTESTL2O c_cblas2.c c_c2chke.c auxiliary.c c_xerbla.c)
  35. set(CTESTL3O c_cblas3.c c_c3chke.c auxiliary.c c_xerbla.c)
  36. # Object files for double precision complex
  37. set(ZTESTL1O c_zblas1.c)
  38. set(ZTESTL2O c_zblas2.c c_z2chke.c auxiliary.c c_xerbla.c)
  39. set(ZTESTL3O c_zblas3.c c_z3chke.c auxiliary.c c_xerbla.c)
  40. if(BUILD_SINGLE)
  41. add_executable(xscblat1 c_sblat1.f ${STESTL1O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  42. add_executable(xscblat2 c_sblat2.f ${STESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  43. add_executable(xscblat3 c_sblat3.f ${STESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  44. target_link_libraries(xscblat1 ${CBLASLIB})
  45. target_link_libraries(xscblat2 ${CBLASLIB})
  46. target_link_libraries(xscblat3 ${CBLASLIB})
  47. add_cblas_test(stest1.out "" xscblat1)
  48. add_cblas_test(stest2.out sin2 xscblat2)
  49. add_cblas_test(stest3.out sin3 xscblat3)
  50. endif()
  51. if(BUILD_DOUBLE)
  52. add_executable(xdcblat1 c_dblat1.f ${DTESTL1O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  53. add_executable(xdcblat2 c_dblat2.f ${DTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  54. add_executable(xdcblat3 c_dblat3.f ${DTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  55. target_link_libraries(xdcblat1 ${CBLASLIB})
  56. target_link_libraries(xdcblat2 ${CBLASLIB})
  57. target_link_libraries(xdcblat3 ${CBLASLIB})
  58. add_cblas_test(dtest1.out "" xdcblat1)
  59. add_cblas_test(dtest2.out din2 xdcblat2)
  60. add_cblas_test(dtest3.out din3 xdcblat3)
  61. endif()
  62. if(BUILD_COMPLEX)
  63. add_executable(xccblat1 c_cblat1.f ${CTESTL1O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  64. add_executable(xccblat2 c_cblat2.f ${CTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  65. add_executable(xccblat3 c_cblat3.f ${CTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  66. target_link_libraries(xccblat1 ${CBLASLIB} ${BLAS_LIBRARIES})
  67. target_link_libraries(xccblat2 ${CBLASLIB})
  68. target_link_libraries(xccblat3 ${CBLASLIB})
  69. add_cblas_test(ctest1.out "" xccblat1)
  70. add_cblas_test(ctest2.out cin2 xccblat2)
  71. add_cblas_test(ctest3.out cin3 xccblat3)
  72. endif()
  73. if(BUILD_COMPLEX16)
  74. add_executable(xzcblat1 c_zblat1.f ${ZTESTL1O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  75. add_executable(xzcblat2 c_zblat2.f ${ZTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  76. add_executable(xzcblat3 c_zblat3.f ${ZTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
  77. target_link_libraries(xzcblat1 ${CBLASLIB})
  78. target_link_libraries(xzcblat2 ${CBLASLIB})
  79. target_link_libraries(xzcblat3 ${CBLASLIB})
  80. add_cblas_test(ztest1.out "" xzcblat1)
  81. add_cblas_test(ztest2.out zin2 xzcblat2)
  82. add_cblas_test(ztest3.out zin3 xzcblat3)
  83. endif()