From c8199998a6ff38cd6f7f1e8d8470f9770f5bf781 Mon Sep 17 00:00:00 2001 From: Weslley S Pereira Date: Thu, 25 May 2023 09:39:49 -0600 Subject: [PATCH] In CMake, install BLAS::BLAS and LAPACK::LAPACK --- BLAS/SRC/CMakeLists.txt | 10 ++++++++++ CMakeLists.txt | 3 +++ 2 files changed, 13 insertions(+) diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt index 4e5894f4d0..1ede93ad33 100644 --- a/BLAS/SRC/CMakeLists.txt +++ b/BLAS/SRC/CMakeLists.txt @@ -29,6 +29,8 @@ # Level 1 BLAS #--------------------------------------------------------- +set(LAPACK_INSTALL_EXPORT_NAME ${BLASLIB}-targets) + set(SBLAS1 isamax.f sasum.f saxpy.f scopy.f sdot.f snrm2.f90 srot.f srotg.f90 sscal.f sswap.f sdsdot.f srotmg.f srotm.f) @@ -117,6 +119,14 @@ set_target_properties( ) lapack_install_library(${BLASLIB}) +add_library(BLAS::BLAS ALIAS ${BLASLIB}) +install(EXPORT ${BLASLIB}-targets + FILE ${BLASLIB}-targets.cmake + NAMESPACE BLAS:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION} + COMPONENT Development +) + if( TEST_FORTRAN_COMPILER ) add_dependencies( ${BLASLIB} run_test_zcomplexabs run_test_zcomplexdiv run_test_zcomplexmult run_test_zminMax ) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ecf8a5094..a8a1903043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -546,7 +546,10 @@ endif() # install tree, if any. set(_lapack_config_install_guard_target "") if(ALL_TARGETS) + add_library(LAPACK::LAPACK ALIAS ${LAPACKLIB}) install(EXPORT ${LAPACKLIB}-targets + FILE ${LAPACKLIB}-targets.cmake + NAMESPACE LAPACK:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION} COMPONENT Development )