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

60 lines
1.5 KiB

  1. project(EigenBlas CXX)
  2. include("../cmake/language_support.cmake")
  3. workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS)
  4. if(EIGEN_Fortran_COMPILER_WORKS)
  5. enable_language(Fortran OPTIONAL)
  6. if(NOT CMAKE_Fortran_COMPILER)
  7. set(EIGEN_Fortran_COMPILER_WORKS OFF)
  8. endif()
  9. endif()
  10. add_custom_target(blas)
  11. set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp)
  12. if(EIGEN_Fortran_COMPILER_WORKS)
  13. set(EigenBlas_SRCS ${EigenBlas_SRCS}
  14. complexdots.f
  15. srotm.f srotmg.f drotm.f drotmg.f
  16. lsame.f dspmv.f ssbmv.f
  17. chbmv.f sspmv.f
  18. zhbmv.f chpmv.f dsbmv.f
  19. zhpmv.f
  20. dtbmv.f stbmv.f ctbmv.f ztbmv.f
  21. )
  22. else()
  23. message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.")
  24. endif()
  25. add_library(eigen_blas_static ${EigenBlas_SRCS})
  26. add_library(eigen_blas SHARED ${EigenBlas_SRCS})
  27. if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
  28. target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
  29. target_link_libraries(eigen_blas ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
  30. endif()
  31. add_dependencies(blas eigen_blas eigen_blas_static)
  32. install(TARGETS eigen_blas eigen_blas_static
  33. RUNTIME DESTINATION bin
  34. LIBRARY DESTINATION lib
  35. ARCHIVE DESTINATION lib)
  36. if(EIGEN_Fortran_COMPILER_WORKS)
  37. if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
  38. add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
  39. else()
  40. add_subdirectory(testing EXCLUDE_FROM_ALL)
  41. endif()
  42. endif()