Skip to content

Commit

Permalink
Merge pull request #390 from mmuetzel/pkg-config
Browse files Browse the repository at this point in the history
Fix pkg-config files on platforms without import libraries.
  • Loading branch information
DrTimothyAldenDavis authored Sep 11, 2023
2 parents 3eac742 + 6ef5b55 commit 299427f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ if ( NOT MSVC )
set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" )
set ( _kinds "SHARED" "STATIC" )
if ( WIN32 )
list ( PREPEND _kinds "IMPORT" )
endif ( )
foreach ( _kind IN LISTS _kinds )
set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" )
if ( ${_lib} MATCHES ${_regex} )
string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} )
Expand Down
6 changes: 5 additions & 1 deletion GraphBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ if ( NOT MSVC )
set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" )
set ( _kinds "SHARED" "STATIC" )
if ( WIN32 )
list ( PREPEND _kinds "IMPORT" )
endif ( )
foreach ( _kind IN LISTS _kinds )
set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" )
if ( ${_lib} MATCHES ${_regex} )
string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} )
Expand Down
16 changes: 10 additions & 6 deletions SPEX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,16 @@ if ( NOT MSVC )
set ( SPEX_STATIC_LIBS_LIST ${SPEX_STATIC_LIBS} )
set ( SPEX_STATIC_LIBS "" )
foreach ( _lib ${SPEX_STATIC_LIBS_LIST} )
string ( FIND ${_lib} "." _pos REVERSE )
if ( ${_pos} EQUAL "-1" )
set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" )
string ( FIND ${_lib} "." _pos REVERSE )
if ( ${_pos} EQUAL "-1" )
set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
set ( _kinds "SHARED" "STATIC" )
if ( WIN32 )
list ( PREPEND _kinds "IMPORT" )
endif ( )
foreach ( _kind IN LISTS _kinds )
set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" )
if ( ${_lib} MATCHES ${_regex} )
string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} )
Expand Down
6 changes: 5 additions & 1 deletion SPQR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ if ( NOT MSVC )
set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" )
set ( _kinds "SHARED" "STATIC" )
if ( WIN32 )
list ( PREPEND _kinds "IMPORT" )
endif ( )
foreach ( _kind IN LISTS _kinds )
set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" )
if ( ${_lib} MATCHES ${_regex} )
string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} )
Expand Down
6 changes: 5 additions & 1 deletion UMFPACK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ if ( NOT MSVC )
set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_lib}" )
continue ()
endif ( )
foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" )
set ( _kinds "SHARED" "STATIC" )
if ( WIN32 )
list ( PREPEND _kinds "IMPORT" )
endif ( )
foreach ( _kind IN LISTS _kinds )
set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" )
if ( ${_lib} MATCHES ${_regex} )
string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} )
Expand Down

0 comments on commit 299427f

Please sign in to comment.