2010-11-20 19:01:17 +08:00
|
|
|
|
|
|
|
project(EigenBlas CXX)
|
|
|
|
|
2020-10-12 19:24:08 +08:00
|
|
|
include(CheckLanguage)
|
|
|
|
check_language(Fortran)
|
|
|
|
if(CMAKE_Fortran_COMPILER)
|
|
|
|
enable_language(Fortran)
|
|
|
|
set(EIGEN_Fortran_COMPILER_WORKS ON)
|
|
|
|
else()
|
|
|
|
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
2010-11-20 19:01:17 +08:00
|
|
|
endif()
|
2009-10-03 00:45:24 +08:00
|
|
|
|
2011-09-21 16:27:38 +08:00
|
|
|
add_custom_target(blas)
|
|
|
|
|
2014-12-12 00:03:41 +08:00
|
|
|
set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp
|
|
|
|
f2c/srotm.c f2c/srotmg.c f2c/drotm.c f2c/drotmg.c
|
|
|
|
f2c/lsame.c f2c/dspmv.c f2c/ssbmv.c f2c/chbmv.c
|
|
|
|
f2c/sspmv.c f2c/zhbmv.c f2c/chpmv.c f2c/dsbmv.c
|
|
|
|
f2c/zhpmv.c f2c/dtbmv.c f2c/stbmv.c f2c/ctbmv.c
|
|
|
|
f2c/ztbmv.c f2c/d_cnjg.c f2c/r_cnjg.c
|
|
|
|
)
|
|
|
|
|
|
|
|
if (EIGEN_Fortran_COMPILER_WORKS)
|
|
|
|
set(EigenBlas_SRCS ${EigenBlas_SRCS} fortran/complexdots.f)
|
2011-10-24 19:36:49 +08:00
|
|
|
else()
|
2014-12-12 00:03:41 +08:00
|
|
|
set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
|
2011-10-24 19:36:49 +08:00
|
|
|
endif()
|
2011-09-21 16:27:38 +08:00
|
|
|
|
2021-06-24 12:09:53 +08:00
|
|
|
set(EIGEN_BLAS_TARGETS "")
|
|
|
|
|
2010-03-25 02:34:18 +08:00
|
|
|
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
2021-06-24 12:09:53 +08:00
|
|
|
list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static)
|
2010-04-19 23:19:22 +08:00
|
|
|
|
2021-06-24 12:09:53 +08:00
|
|
|
if (EIGEN_BUILD_SHARED_LIBS)
|
|
|
|
add_library(eigen_blas SHARED ${EigenBlas_SRCS})
|
|
|
|
list(APPEND EIGEN_BLAS_TARGETS eigen_blas)
|
2010-04-19 23:19:22 +08:00
|
|
|
endif()
|
|
|
|
|
2021-06-24 12:09:53 +08:00
|
|
|
foreach(target IN LISTS EIGEN_BLAS_TARGETS)
|
|
|
|
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
|
|
|
target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
|
|
|
endif()
|
2009-09-25 19:08:39 +08:00
|
|
|
|
2021-06-24 12:09:53 +08:00
|
|
|
add_dependencies(blas ${target})
|
|
|
|
install(TARGETS ${target}
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib)
|
|
|
|
endforeach()
|
2009-09-25 19:08:39 +08:00
|
|
|
|
2011-10-24 19:36:49 +08:00
|
|
|
if(EIGEN_Fortran_COMPILER_WORKS)
|
2010-11-20 19:01:17 +08:00
|
|
|
|
2021-10-25 03:00:11 +08:00
|
|
|
if(EIGEN_BUILD_TESTING)
|
2017-01-02 16:09:21 +08:00
|
|
|
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
|
|
|
add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
|
|
|
|
else()
|
|
|
|
add_subdirectory(testing EXCLUDE_FROM_ALL)
|
|
|
|
endif()
|
2010-12-12 20:10:00 +08:00
|
|
|
endif()
|
|
|
|
|
2011-09-21 16:27:38 +08:00
|
|
|
endif()
|
|
|
|
|