From 050d77d66322c68f90ade4f43849754081a9e5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 30 Nov 2023 10:50:52 +0100 Subject: [PATCH] FindGraphBLAS: Try to make sure GRAPHBLAS_STATIC is really a static library --- LAGraph/cmake_modules/FindGraphBLAS.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index 31464b6409..f72fc07ea9 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -120,16 +120,14 @@ find_library ( GRAPHBLAS_LIBRARY ) if ( MSVC ) - set ( STATIC_SUFFIX .lib ) set ( STATIC_NAME graphblas_static ) else ( ) - set ( STATIC_SUFFIX .a ) set ( STATIC_NAME graphblas ) endif ( ) # static SuiteSparse:GraphBLAS library set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -set ( CMAKE_FIND_LIBRARY_SUFFIXES ${STATIC_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) +set ( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ) find_library ( GRAPHBLAS_STATIC NAMES ${STATIC_NAME} HINTS ${GRAPHBLAS_ROOT} @@ -140,6 +138,9 @@ find_library ( GRAPHBLAS_STATIC PATH_SUFFIXES lib build alternative ) set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) +if ( MINGW AND GRAPHBLAS_STATIC MATCHES ".*\.dll\.a" ) + set ( GRAPHBLAS_STATIC "" ) +endif ( ) # get version of the library from the dynamic library name get_filename_component ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH ) @@ -214,13 +215,13 @@ else ( ) endif ( ) # Create target from information found -if ( NOT "${GRAPHBLAS_LIBRARY}" STREQUAL "" ) +if ( GRAPHBLAS_LIBRARY ) add_library ( GraphBLAS::GraphBLAS UNKNOWN IMPORTED ) set_target_properties ( GraphBLAS::GraphBLAS PROPERTIES IMPORTED_LOCATION "${GRAPHBLAS_LIBRARY}" IMPORTED_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" ) endif ( ) -if ( NOT "${GRAPHBLAS_STATIC}" STREQUAL "" ) +if ( GRAPHBLAS_STATIC ) add_library ( GraphBLAS::GraphBLAS_static UNKNOWN IMPORTED ) set_target_properties ( GraphBLAS::GraphBLAS_static PROPERTIES IMPORTED_LOCATION "${GRAPHBLAS_STATIC}"