• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
10  if(NOT CMAKE_Fortran_COMPILER)
11    set(EIGEN_Fortran_COMPILER_WORKS OFF)
12  endif()
13endif()
14
15add_custom_target(blas)
16
17set(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
25if (EIGEN_Fortran_COMPILER_WORKS)
26  set(EigenBlas_SRCS ${EigenBlas_SRCS} fortran/complexdots.f)
27else()
28  set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
29endif()
30
31add_library(eigen_blas_static ${EigenBlas_SRCS})
32add_library(eigen_blas SHARED ${EigenBlas_SRCS})
33
34if(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})
37endif()
38
39add_dependencies(blas eigen_blas eigen_blas_static)
40
41install(TARGETS eigen_blas eigen_blas_static
42        RUNTIME DESTINATION bin
43        LIBRARY DESTINATION lib
44        ARCHIVE DESTINATION lib)
45
46if(EIGEN_Fortran_COMPILER_WORKS)
47
48if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
49  add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
50else()
51  add_subdirectory(testing EXCLUDE_FROM_ALL)
52endif()
53
54endif()
55
56