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.

55 lines
1.6 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. f2c/srotm.c f2c/srotmg.c f2c/drotm.c f2c/drotmg.c
  13. f2c/lsame.c f2c/dspmv.c f2c/ssbmv.c f2c/chbmv.c
  14. f2c/sspmv.c f2c/zhbmv.c f2c/chpmv.c f2c/dsbmv.c
  15. f2c/zhpmv.c f2c/dtbmv.c f2c/stbmv.c f2c/ctbmv.c
  16. f2c/ztbmv.c f2c/d_cnjg.c f2c/r_cnjg.c
  17. )
  18. if (EIGEN_Fortran_COMPILER_WORKS)
  19. set(EigenBlas_SRCS ${EigenBlas_SRCS} fortran/complexdots.f)
  20. else()
  21. set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
  22. endif()
  23. add_library(eigen_blas_static ${EigenBlas_SRCS})
  24. add_library(eigen_blas SHARED ${EigenBlas_SRCS})
  25. if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
  26. target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
  27. target_link_libraries(eigen_blas ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
  28. endif()
  29. add_dependencies(blas eigen_blas eigen_blas_static)
  30. install(TARGETS eigen_blas eigen_blas_static
  31. RUNTIME DESTINATION bin
  32. LIBRARY DESTINATION lib
  33. ARCHIVE DESTINATION lib)
  34. if(EIGEN_Fortran_COMPILER_WORKS)
  35. if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
  36. add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
  37. else()
  38. add_subdirectory(testing EXCLUDE_FROM_ALL)
  39. endif()
  40. endif()