Skip to content

Commit

Permalink
Rename CMake target umfpack to UMFPACK.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Jul 22, 2023
1 parent 9240b11 commit 5f7182a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 49 deletions.
16 changes: 8 additions & 8 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,15 +418,15 @@ else ( )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime )
endif ( )

# umfpack:
target_link_libraries ( my PRIVATE SuiteSparse::umfpack )
target_link_libraries ( my_cxx PRIVATE SuiteSparse::umfpack )
if ( TARGET SuiteSparse::umfpack_static )
target_link_libraries ( my_static PUBLIC SuiteSparse::umfpack_static )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::umfpack_static )
# UMFPACK:
target_link_libraries ( my PRIVATE SuiteSparse::UMFPACK )
target_link_libraries ( my_cxx PRIVATE SuiteSparse::UMFPACK )
if ( TARGET SuiteSparse::UMFPACK_static )
target_link_libraries ( my_static PUBLIC SuiteSparse::UMFPACK_static )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::UMFPACK_static )
else ( )
target_link_libraries ( my_static PUBLIC SuiteSparse::umfpack )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::umfpack )
target_link_libraries ( my_static PUBLIC SuiteSparse::UMFPACK )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::UMFPACK )
endif ( )

#-------------------------------------------------------------------------------
Expand Down
75 changes: 38 additions & 37 deletions UMFPACK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,18 @@ include_directories ( Source Include )

file ( GLOB UMFPACK_SOURCES "Source2/*.c" )

add_library ( umfpack SHARED ${UMFPACK_SOURCES} )
add_library ( UMFPACK SHARED ${UMFPACK_SOURCES} )

set_target_properties ( umfpack PROPERTIES
set_target_properties ( UMFPACK PROPERTIES
VERSION ${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}
C_STANDARD 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME umfpack
SOVERSION ${UMFPACK_VERSION_MAJOR}
PUBLIC_HEADER "Include/umfpack.h"
WINDOWS_EXPORT_ALL_SYMBOLS ON )

target_include_directories ( umfpack
target_include_directories ( UMFPACK
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" )

Expand All @@ -156,21 +157,21 @@ target_include_directories ( umfpack
#-------------------------------------------------------------------------------

if ( NOT NSTATIC )
add_library ( umfpack_static STATIC ${UMFPACK_SOURCES} )
add_library ( UMFPACK_static STATIC ${UMFPACK_SOURCES} )

set_target_properties ( umfpack_static PROPERTIES
set_target_properties ( UMFPACK_static PROPERTIES
VERSION ${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}
C_STANDARD 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME umfpack
SOVERSION ${UMFPACK_VERSION_MAJOR} )

if ( MSVC )
set_target_properties ( umfpack_static PROPERTIES
set_target_properties ( UMFPACK_static PROPERTIES
OUTPUT_NAME umfpack_static )
endif ( )

target_include_directories ( umfpack_static
target_include_directories ( UMFPACK_static
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" )

Expand All @@ -181,13 +182,13 @@ endif ( )
#-------------------------------------------------------------------------------

# SuiteSparseConfig:
target_link_libraries ( umfpack PRIVATE SuiteSparse::SuiteSparseConfig )
target_include_directories ( umfpack PUBLIC "$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
target_link_libraries ( UMFPACK PRIVATE SuiteSparse::SuiteSparseConfig )
target_include_directories ( UMFPACK PUBLIC "$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
if ( NOT NSTATIC )
if ( TARGET SuiteSparse::SuiteSparseConfig_static )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::SuiteSparseConfig_static )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig_static )
else ( )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::SuiteSparseConfig )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig )
endif ( )
endif ( )

Expand All @@ -196,56 +197,56 @@ if ( OPENMP_FOUND )
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ")
message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ")
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ")
target_link_libraries ( umfpack PRIVATE ${OpenMP_C_LIBRARIES} )
target_link_libraries ( UMFPACK PRIVATE ${OpenMP_C_LIBRARIES} )
if ( NOT NSTATIC )
target_link_libraries ( umfpack_static PUBLIC ${OpenMP_C_LIBRARIES} )
target_link_libraries ( UMFPACK_static PUBLIC ${OpenMP_C_LIBRARIES} )
endif ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " )
include_directories ( ${OpenMP_C_INCLUDE_DIRS} )
endif ( )

# libm:
if ( NOT WIN32 )
target_link_libraries ( umfpack PRIVATE m )
target_link_libraries ( UMFPACK PRIVATE m )
if ( NOT NSTATIC )
target_link_libraries ( umfpack_static PUBLIC m )
target_link_libraries ( UMFPACK_static PUBLIC m )
endif ( )
endif ( )

# AMD:
target_link_libraries ( umfpack PRIVATE SuiteSparse::AMD )
target_include_directories ( umfpack PUBLIC
target_link_libraries ( UMFPACK PRIVATE SuiteSparse::AMD )
target_include_directories ( UMFPACK PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::AMD,INTERFACE_INCLUDE_DIRECTORIES>" )
if ( NOT NSTATIC )
if ( TARGET SuiteSparse::AMD_static )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::AMD_static )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD_static )
else ( )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::AMD )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD )
endif ( )
endif ( )

# BLAS:
message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ")
message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ")
message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ")
target_link_libraries ( umfpack PRIVATE ${BLAS_LIBRARIES} )
target_link_libraries ( UMFPACK PRIVATE ${BLAS_LIBRARIES} )
if ( NOT NSTATIC )
target_link_libraries ( umfpack_static PUBLIC ${BLAS_LIBRARIES} )
target_link_libraries ( UMFPACK_static PUBLIC ${BLAS_LIBRARIES} )
endif ( )
include_directories ( ${BLAS_INCLUDE_DIRS} )

# CHOLMOD:
if ( NOT NCHOLMOD )
# link with CHOLMOD and its dependencies, both required and optional
target_link_libraries ( umfpack PRIVATE
target_link_libraries ( UMFPACK PRIVATE
SuiteSparse::CHOLMOD ${CHOLMOD_CUDA_LIBRARIES} )
if ( NOT NSTATIC )
target_link_libraries ( umfpack_static PUBLIC
target_link_libraries ( UMFPACK_static PUBLIC
${CHOLMOD_CUDA_STATIC} )
if ( TARGET SuiteSparse::CHOLMOD_static )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::CHOLMOD_static )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD_static )
else ( )
target_link_libraries ( umfpack_static PUBLIC SuiteSparse::CHOLMOD )
target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD )
endif ( )
endif ( )
endif ( )
Expand All @@ -256,14 +257,14 @@ endif ( )

include ( CMakePackageConfigHelpers )

install ( TARGETS umfpack
install ( TARGETS UMFPACK
EXPORT UMFPACKTargets
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
if ( NOT NSTATIC )
install ( TARGETS umfpack_static
install ( TARGETS UMFPACK_static
EXPORT UMFPACKTargets
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} )
endif ( )
Expand Down Expand Up @@ -332,11 +333,11 @@ if ( DEMO )
endif ( )

# Libraries required for Demo programs
target_link_libraries ( umfpack_simple PUBLIC umfpack SuiteSparse::SuiteSparseConfig )
target_link_libraries ( umfpack_di_demo PUBLIC umfpack )
target_link_libraries ( umfpack_dl_demo PUBLIC umfpack )
target_link_libraries ( umfpack_zi_demo PUBLIC umfpack )
target_link_libraries ( umfpack_zl_demo PUBLIC umfpack )
target_link_libraries ( umfpack_simple PUBLIC UMFPACK SuiteSparse::SuiteSparseConfig )
target_link_libraries ( umfpack_di_demo PUBLIC UMFPACK )
target_link_libraries ( umfpack_dl_demo PUBLIC UMFPACK )
target_link_libraries ( umfpack_zi_demo PUBLIC UMFPACK )
target_link_libraries ( umfpack_zl_demo PUBLIC UMFPACK )
if ( NOT WIN32 )
# This is only needed because the demos might be linked before those
# libraries are installed. Would it be better to set the rpath instead?
Expand All @@ -351,11 +352,11 @@ if ( DEMO )
endif ( )
if ( NOT NFORTRAN )
# Fortran demos
target_link_libraries ( umf4 PUBLIC umfpack SuiteSparse::AMD )
target_link_libraries ( umf4hb PUBLIC umfpack )
target_link_libraries ( umf4zhb PUBLIC umfpack )
target_link_libraries ( umf4hb64 PUBLIC umfpack )
target_link_libraries ( umf4zhb64 PUBLIC umfpack )
target_link_libraries ( umf4 PUBLIC UMFPACK SuiteSparse::AMD )
target_link_libraries ( umf4hb PUBLIC UMFPACK )
target_link_libraries ( umf4zhb PUBLIC UMFPACK )
target_link_libraries ( umf4hb64 PUBLIC UMFPACK )
target_link_libraries ( umf4zhb64 PUBLIC UMFPACK )
if ( NOT WIN32 )
# This is only needed because the demos might be linked before
# those libraries are installed. Would it be better to set the
Expand Down
8 changes: 4 additions & 4 deletions UMFPACK/Config/UMFPACKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

# Finds the UMFPACK include file and compiled library.
# The following targets are defined:
# SuiteSparse::umfpack - for the shared library (if available)
# SuiteSparse::umfpack_static - for the static library (if available)
# SuiteSparse::UMFPACK - for the shared library (if available)
# SuiteSparse::UMFPACK_static - for the static library (if available)

# For backward compatibility the following variables are set:

Expand All @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/UMFPACKTargets.cmake )

# The following is only for backward compatibility with FindUMFPACK.

set ( _target_shared SuiteSparse::umfpack )
set ( _target_static SuiteSparse::umfpack_static )
set ( _target_shared SuiteSparse::UMFPACK )
set ( _target_static SuiteSparse::UMFPACK_static )
set ( _var_prefix "UMFPACK" )

get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES )
Expand Down

0 comments on commit 5f7182a

Please sign in to comment.