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.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. if (MSVC AND "${CMAKE_C_COMPILER_ID}" MATCHES Clang)
  4. set(OpenBLAS_utest_src utest_main2.c)
  5. else ()
  6. set(OpenBLAS_utest_src
  7. utest_main.c
  8. test_amax.c
  9. test_rotmg.c
  10. )
  11. endif ()
  12. if (NOT NO_LAPACK)
  13. set(OpenBLAS_utest_src
  14. ${OpenBLAS_utest_src}
  15. test_potrs.c
  16. )
  17. endif()
  18. set(OpenBLAS_utest_bin openblas_utest)
  19. add_executable(${OpenBLAS_utest_bin} ${OpenBLAS_utest_src})
  20. target_link_libraries(${OpenBLAS_utest_bin} ${OpenBLAS_LIBNAME})
  21. if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  22. target_link_libraries(${OpenBLAS_utest_bin} m)
  23. endif()
  24. if (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
  25. set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS")
  26. endif()
  27. #Set output for utest
  28. set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
  29. foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
  30. string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
  31. set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_CURRENT_BINARY_DIR})
  32. endforeach()
  33. if (MSVC)
  34. add_custom_command(TARGET ${OpenBLAS_utest_bin}
  35. POST_BUILD
  36. COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/${OpenBLAS_LIBNAME}.dll ${CMAKE_CURRENT_BINARY_DIR}/.
  37. )
  38. endif()
  39. add_test(${OpenBLAS_utest_bin} ${CMAKE_CURRENT_BINARY_DIR}/${OpenBLAS_utest_bin})