| # SPDX-FileCopyrightText: The Eigen Authors | |
| # SPDX-License-Identifier: MPL-2.0 | |
| project(EigenBlas CXX) | |
| if(EIGEN_BUILD_BLAS) | |
| add_custom_target(blas) | |
| set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp | |
| lsame.cpp complexdots.cpp | |
| ) | |
| set(EIGEN_BLAS_TARGETS "") | |
| add_library(eigen_blas_static STATIC ${EigenBlas_SRCS}) | |
| list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static) | |
| if (EIGEN_BUILD_SHARED_LIBS) | |
| add_library(eigen_blas SHARED ${EigenBlas_SRCS} "eigen_blas.def") | |
| target_compile_definitions(eigen_blas PUBLIC "EIGEN_BLAS_BUILD_DLL") | |
| set_target_properties(eigen_blas PROPERTIES CXX_VISIBILITY_PRESET hidden | |
| VERSION ${EIGEN_VERSION_NUMBER} | |
| SOVERSION ${EIGEN_MAJOR_VERSION}) | |
| list(APPEND EIGEN_BLAS_TARGETS eigen_blas) | |
| endif() | |
| 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() | |
| add_dependencies(blas ${target}) | |
| if(EIGEN_INSTALL) | |
| install(TARGETS ${target} | |
| RUNTIME DESTINATION bin | |
| LIBRARY DESTINATION lib | |
| ARCHIVE DESTINATION lib) | |
| endif() | |
| endforeach() | |
| if(EIGEN_BUILD_TESTING) | |
| 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() | |
| endif() | |
| endif() |