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