Skip to content

Commit a667148

Browse files
only add /Include workaround if the directory exists
1 parent b177d27 commit a667148

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

cmake_modules/FindGraphBLAS.cmake

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ if ( GraphBLAS_FOUND )
8686
# (did not have "/Include")
8787
get_property ( _inc TARGET SuiteSparse::GraphBLAS PROPERTY
8888
INTERFACE_INCLUDE_DIRECTORIES )
89-
if ( "${_graphblas_aliased}" STREQUAL "" )
90-
target_include_directories ( SuiteSparse::GraphBLAS INTERFACE
91-
${_inc}/Include )
92-
else ( )
93-
target_include_directories ( ${_graphblas_aliased} INTERFACE
94-
${_inc}/Include )
89+
if ( IS_DIRECTORY ${_inc}/Include )
90+
if ( "${_graphblas_aliased}" STREQUAL "" )
91+
target_include_directories ( SuiteSparse::GraphBLAS INTERFACE
92+
${_inc}/Include )
93+
else ( )
94+
target_include_directories ( ${_graphblas_aliased} INTERFACE
95+
${_inc}/Include )
96+
endif ( )
97+
message ( STATUS "additional include: ${_inc}/Include" )
9598
endif ( )
96-
message ( STATUS "additional include: ${_inc}/Include" )
9799
endif ( )
98100
if ( "${_graphblas_aliased}" STREQUAL "" )
99101
add_library ( GraphBLAS::GraphBLAS ALIAS SuiteSparse::GraphBLAS )
@@ -112,14 +114,16 @@ if ( GraphBLAS_FOUND )
112114
# (did not have "/Include")
113115
get_property ( _inc TARGET SuiteSparse::GraphBLAS_static PROPERTY
114116
INTERFACE_INCLUDE_DIRECTORIES )
115-
if ( "${_graphblas_aliased}" STREQUAL "" )
116-
target_include_directories ( SuiteSparse::GraphBLAS_static INTERFACE
117-
${_inc}/Include )
118-
else ( )
119-
target_include_directories ( ${_graphblas_aliased} INTERFACE
120-
${_inc}/Include )
117+
if ( IS_DIRECTORY ${_inc}/Include )
118+
if ( "${_graphblas_aliased}" STREQUAL "" )
119+
target_include_directories ( SuiteSparse::GraphBLAS_static INTERFACE
120+
${_inc}/Include )
121+
else ( )
122+
target_include_directories ( ${_graphblas_aliased} INTERFACE
123+
${_inc}/Include )
124+
endif ( )
125+
message ( STATUS "additional include: ${_inc}/Include" )
121126
endif ( )
122-
message ( STATUS "additional include: ${_inc}/Include" )
123127
endif ( )
124128
if ( "${_graphblas_aliased}" STREQUAL "" )
125129
add_library ( GraphBLAS::GraphBLAS_static ALIAS SuiteSparse::GraphBLAS_static )

0 commit comments

Comments
 (0)