blob: a9bc051374a3af8eeb0240d0f077c2b36ae6ae4e [file] [log] [blame]
Narayan Kamathc981c482012-11-02 10:59:05 +00001
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)
Carlos Hernandez7faaa9f2014-08-05 17:53:32 -070010 if(NOT CMAKE_Fortran_COMPILER)
11 set(EIGEN_Fortran_COMPILER_WORKS OFF)
12 endif()
Narayan Kamathc981c482012-11-02 10:59:05 +000013endif()
14
15add_custom_target(blas)
16
17set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp)
18
19if(EIGEN_Fortran_COMPILER_WORKS)
20
21set(EigenBlas_SRCS ${EigenBlas_SRCS}
22 complexdots.f
23 srotm.f srotmg.f drotm.f drotmg.f
Carlos Hernandez7faaa9f2014-08-05 17:53:32 -070024 lsame.f dspmv.f ssbmv.f
25 chbmv.f sspmv.f
26 zhbmv.f chpmv.f dsbmv.f
27 zhpmv.f
Narayan Kamathc981c482012-11-02 10:59:05 +000028 dtbmv.f stbmv.f ctbmv.f ztbmv.f
29)
30else()
31
32message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.")
33
34endif()
35
36add_library(eigen_blas_static ${EigenBlas_SRCS})
37add_library(eigen_blas SHARED ${EigenBlas_SRCS})
38
39if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
40 target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
41 target_link_libraries(eigen_blas ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
42endif()
43
44add_dependencies(blas eigen_blas eigen_blas_static)
45
46install(TARGETS eigen_blas eigen_blas_static
47 RUNTIME DESTINATION bin
48 LIBRARY DESTINATION lib
49 ARCHIVE DESTINATION lib)
50
51if(EIGEN_Fortran_COMPILER_WORKS)
52
53if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
54 add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
55else()
56 add_subdirectory(testing EXCLUDE_FROM_ALL)
57endif()
58
59endif()
60