From 9240b11f8bd1a2a4dd54fe715f3b1bf3b69292b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Sat, 22 Jul 2023 15:31:31 +0200 Subject: [PATCH] Move `umfpack` target to `SuiteSparse::` namespace. --- Example/CMakeLists.txt | 14 +++++++------- UMFPACK/CMakeLists.txt | 2 ++ UMFPACK/Config/UMFPACKConfig.cmake.in | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 1e0f5c35f0..01803a4a2b 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -419,14 +419,14 @@ else ( ) endif ( ) # umfpack: -target_link_libraries ( my PRIVATE umfpack ) -target_link_libraries ( my_cxx PRIVATE umfpack ) -if ( TARGET umfpack_static ) - target_link_libraries ( my_static PUBLIC umfpack_static ) - target_link_libraries ( my_cxx_static PUBLIC umfpack_static ) +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 umfpack ) - target_link_libraries ( my_cxx_static PUBLIC umfpack ) + target_link_libraries ( my_static PUBLIC SuiteSparse::umfpack ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::umfpack ) endif ( ) #------------------------------------------------------------------------------- diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index 8daaf04823..6f1e463d92 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -270,10 +270,12 @@ endif ( ) # create (temporary) export target file during build export ( EXPORT UMFPACKTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT UMFPACKTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/UMFPACK ) configure_package_config_file ( diff --git a/UMFPACK/Config/UMFPACKConfig.cmake.in b/UMFPACK/Config/UMFPACKConfig.cmake.in index 6c49671ed8..83e01309a9 100644 --- a/UMFPACK/Config/UMFPACKConfig.cmake.in +++ b/UMFPACK/Config/UMFPACKConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the UMFPACK include file and compiled library. # The following targets are defined: -# umfpack - for the shared library (if available) -# 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: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/UMFPACKTargets.cmake ) # The following is only for backward compatibility with FindUMFPACK. -set ( _target_shared umfpack ) -set ( _target_static 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 )