Skip to content

Commit

Permalink
creating GraphBLAS:: target for older GraphBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 5, 2023
1 parent 01f7a58 commit 482897a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmake_modules/FindGraphBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt:
# changes to this will likely be required.


## New versions of SuiteSparse GraphBLAS (8.0.3 and newer) ##
## New versions of SuiteSparse GraphBLAS (8.3.0 and newer) ##

message ( STATUS "Looking for SuiteSparse GraphBLAS" )

find_package ( GraphBLAS ${GraphBLAS_FIND_VERSION} CONFIG
PATHS ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/../GraphBLAS/build NO_DEFAULT_PATH )
Expand Down Expand Up @@ -97,6 +99,8 @@ endif ( )

## Older versions of SuiteSparse GraphBLAS (or different vendor?) ##

message ( STATUS "Looking for vanilla GraphBLAS (or older SuiteSparse)" )

# "Include" for SuiteSparse:GraphBLAS
find_path ( GRAPHBLAS_INCLUDE_DIR
NAMES GraphBLAS.h
Expand Down Expand Up @@ -215,15 +219,18 @@ else ( )
endif ( )

# Create target from information found

if ( GRAPHBLAS_LIBRARY )
message ( STATUS "Create target GraphBLAS::GraphBLAS" )
add_library ( GraphBLAS::GraphBLAS UNKNOWN IMPORTED )
set_target_properties ( GraphBLAS::GraphBLAS PROPERTIES
IMPORTED_LOCATION "${GRAPHBLAS_LIBRARY}"
IMPORTED_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" )
INTERFACE_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" )
endif ( )
if ( GRAPHBLAS_STATIC )
message ( STATUS "Create target GraphBLAS::GraphBLAS_static" )
add_library ( GraphBLAS::GraphBLAS_static UNKNOWN IMPORTED )
set_target_properties ( GraphBLAS::GraphBLAS_static PROPERTIES
IMPORTED_LOCATION "${GRAPHBLAS_STATIC}"
IMPORTED_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" )
INTERFACE_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" )
endif ( )

0 comments on commit 482897a

Please sign in to comment.