Skip to content

Commit

Permalink
LDL: Avoid overlinking.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Oct 30, 2023
1 parent 48fe2f7 commit df46377
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions LDL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ project ( ldl
#-------------------------------------------------------------------------------
# find library dependencies
#-------------------------------------------------------------------------------
option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." OFF )

find_package ( SuiteSparse_config 7.2.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
find_package ( SuiteSparse_config 7.2.0 REQUIRED )
endif ( )
find_package ( AMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::AMD )
find_package ( AMD 3.2.0 REQUIRED )

if ( DEMO )
find_package ( AMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::AMD )
find_package ( AMD 3.2.0 )
endif ( )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -129,25 +133,13 @@ if ( NOT WIN32 )
endif ( )
endif ( )

target_link_libraries ( LDL PRIVATE
SuiteSparse::AMD SuiteSparse::SuiteSparseConfig )
target_include_directories ( LDL PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )

if ( NOT NSTATIC )
if ( TARGET SuiteSparse::AMD_static )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD_static )
else ( )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD )
endif ( )
if ( TARGET SuiteSparse::SuiteSparseConfig_static )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig_static )
else ( )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig )
endif ( )
target_include_directories ( LDL_static PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
endif ( )


#-------------------------------------------------------------------------------
# LDL installation location
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -232,7 +224,6 @@ endif ( )
# Demo library and programs
#-------------------------------------------------------------------------------

option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off )
if ( DEMO )

#---------------------------------------------------------------------------
Expand Down

0 comments on commit df46377

Please sign in to comment.