1 2project(EigenBlas CXX) 3 4include("../cmake/language_support.cmake") 5 6workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS) 7 8if(EIGEN_Fortran_COMPILER_WORKS) 9 enable_language(Fortran OPTIONAL) 10endif() 11 12add_custom_target(blas) 13 14set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp) 15 16if(EIGEN_Fortran_COMPILER_WORKS) 17 18set(EigenBlas_SRCS ${EigenBlas_SRCS} 19 complexdots.f 20 srotm.f srotmg.f drotm.f drotmg.f 21 lsame.f chpr2.f dspmv.f dtpsv.f ssbmv.f sspr.f stpmv.f 22 zhpr2.f chbmv.f chpr.f ctpmv.f dspr2.f sspmv.f stpsv.f 23 zhbmv.f zhpr.f ztpmv.f chpmv.f ctpsv.f dsbmv.f dspr.f dtpmv.f sspr2.f 24 zhpmv.f ztpsv.f 25 dtbmv.f stbmv.f ctbmv.f ztbmv.f 26) 27else() 28 29message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.") 30 31endif() 32 33add_library(eigen_blas_static ${EigenBlas_SRCS}) 34add_library(eigen_blas SHARED ${EigenBlas_SRCS}) 35 36if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 37 target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 38 target_link_libraries(eigen_blas ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 39endif() 40 41add_dependencies(blas eigen_blas eigen_blas_static) 42 43install(TARGETS eigen_blas eigen_blas_static 44 RUNTIME DESTINATION bin 45 LIBRARY DESTINATION lib 46 ARCHIVE DESTINATION lib) 47 48if(EIGEN_Fortran_COMPILER_WORKS) 49 50if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) 51 add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest 52else() 53 add_subdirectory(testing EXCLUDE_FROM_ALL) 54endif() 55 56endif() 57 58