diff --git a/AMD/CMakeLists.txt b/AMD/CMakeLists.txt index 7ae67e9b3..36bd3dc1c 100644 --- a/AMD/CMakeLists.txt +++ b/AMD/CMakeLists.txt @@ -58,7 +58,7 @@ endif ( ) find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -87,16 +87,17 @@ else ( ) file ( GLOB AMD_SOURCES "Source/*.c" ) endif ( ) -add_library ( amd SHARED ${AMD_SOURCES} ) -set_target_properties ( amd PROPERTIES +add_library ( AMD SHARED ${AMD_SOURCES} ) +set_target_properties ( AMD PROPERTIES VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME amd SOVERSION ${AMD_VERSION_MAJOR} PUBLIC_HEADER "Include/amd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( amd +target_include_directories ( AMD INTERFACE "$" "$" ) @@ -105,8 +106,8 @@ target_include_directories ( amd #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( amd_static STATIC ${AMD_SOURCES} ) - set_target_properties ( amd_static PROPERTIES + add_library ( AMD_static STATIC ${AMD_SOURCES} ) + set_target_properties ( AMD_static PROPERTIES VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -114,11 +115,11 @@ if ( NOT NSTATIC ) SOVERSION ${AMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( amd_static PROPERTIES + set_target_properties ( AMD_static PROPERTIES OUTPUT_NAME amd_static ) endif ( ) - target_include_directories ( amd_static + target_include_directories ( AMD_static INTERFACE "$" "$" ) @@ -128,22 +129,23 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( amd PRIVATE suitesparseconfig ) -target_include_directories ( amd PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( AMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( AMD PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( amd_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( amd_static PUBLIC suitesparseconfig ) + target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( amd PRIVATE m ) + target_link_libraries ( AMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( amd_static PUBLIC m ) + target_link_libraries ( AMD_static PUBLIC m ) endif ( ) endif ( ) @@ -153,24 +155,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS amd +install ( TARGETS AMD EXPORT AMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS amd_static + install ( TARGETS AMD_static EXPORT AMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT AMDTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/AMDTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT AMDTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD ) configure_package_config_file ( @@ -214,13 +218,13 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( amd_demo PUBLIC amd ) - target_link_libraries ( amd_l_demo PUBLIC amd ) - target_link_libraries ( amd_demo2 PUBLIC amd ) - target_link_libraries ( amd_simple PUBLIC amd ) + target_link_libraries ( amd_demo PUBLIC AMD ) + target_link_libraries ( amd_l_demo PUBLIC AMD ) + target_link_libraries ( amd_demo2 PUBLIC AMD ) + target_link_libraries ( amd_simple PUBLIC AMD ) if ( NOT NFORTRAN ) - target_link_libraries ( amd_f77demo PUBLIC amd ) - target_link_libraries ( amd_f77simple PUBLIC amd ) + target_link_libraries ( amd_f77demo PUBLIC AMD ) + target_link_libraries ( amd_f77simple PUBLIC AMD ) endif ( ) else ( ) diff --git a/AMD/Config/AMDConfig.cmake.in b/AMD/Config/AMDConfig.cmake.in index ab86fa335..9b26776d7 100644 --- a/AMD/Config/AMDConfig.cmake.in +++ b/AMD/Config/AMDConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the AMD include file and compiled library. # The following targets are defined: -# amd - for the shared library (if available) -# amd_static - for the static library (if available) +# SuiteSparse::AMD - for the shared library (if available) +# SuiteSparse::AMD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/AMDTargets.cmake ) # The following is only for backward compatibility with FindAMD. -set ( _target_shared amd ) -set ( _target_static amd_static ) +set ( _target_shared SuiteSparse::AMD ) +set ( _target_static SuiteSparse::AMD_static ) set ( _var_prefix "AMD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/BTF/CMakeLists.txt b/BTF/CMakeLists.txt index 9425a32a4..32e7b55f8 100644 --- a/BTF/CMakeLists.txt +++ b/BTF/CMakeLists.txt @@ -45,7 +45,7 @@ project ( btf find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -68,17 +68,18 @@ include_directories ( Source Include ) file ( GLOB BTF_SOURCES "Source/*.c" ) -add_library ( btf SHARED ${BTF_SOURCES} ) +add_library ( BTF SHARED ${BTF_SOURCES} ) -set_target_properties ( btf PROPERTIES +set_target_properties ( BTF PROPERTIES VERSION ${BTF_VERSION_MAJOR}.${BTF_VERSION_MINOR}.${BTF_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME btf SOVERSION ${BTF_VERSION_MAJOR} PUBLIC_HEADER "Include/btf.h" WINDOWS_EXPORT_ALL_SYMBOLS ON) -target_include_directories ( btf +target_include_directories ( BTF INTERFACE "$" "$" ) @@ -87,9 +88,9 @@ target_include_directories ( btf #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( btf_static STATIC ${BTF_SOURCES} ) + add_library ( BTF_static STATIC ${BTF_SOURCES} ) - set_target_properties ( btf_static PROPERTIES + set_target_properties ( BTF_static PROPERTIES VERSION ${BTF_VERSION_MAJOR}.${BTF_VERSION_MINOR}.${BTF_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -97,11 +98,11 @@ if ( NOT NSTATIC ) SOVERSION ${BTF_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( btf_static PROPERTIES + set_target_properties ( BTF_static PROPERTIES OUTPUT_NAME btf_static ) endif ( ) - target_include_directories ( btf_static + target_include_directories ( BTF_static INTERFACE "$" "$" ) @@ -111,22 +112,23 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( btf PRIVATE suitesparseconfig ) -target_include_directories ( btf PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( BTF PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( BTF PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( btf_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( BTF_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( btf_static PUBLIC suitesparseconfig ) + target_link_libraries ( BTF_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( btf PRIVATE m ) + target_link_libraries ( BTF PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( btf_static PUBLIC m ) + target_link_libraries ( BTF_static PUBLIC m ) endif ( ) endif ( ) @@ -136,24 +138,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS btf +install ( TARGETS BTF EXPORT BTFTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS btf_static + install ( TARGETS BTF_static EXPORT BTFTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT BTFTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/BTFTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT BTFTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/BTF ) configure_package_config_file ( diff --git a/BTF/Config/BTFConfig.cmake.in b/BTF/Config/BTFConfig.cmake.in index 1ceb6f2e5..26f707e14 100644 --- a/BTF/Config/BTFConfig.cmake.in +++ b/BTF/Config/BTFConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the BTF include file and compiled library. # The following targets are defined: -# btf - for the shared library (if available) -# btf_static - for the static library (if available) +# SuiteSparse::BTF - for the shared library (if available) +# SuiteSparse::BTF_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/BTFTargets.cmake ) # The following is only for backward compatibility with FindBTF. -set ( _target_shared btf ) -set ( _target_static btf_static ) +set ( _target_shared SuiteSparse::BTF ) +set ( _target_static SuiteSparse::BTF_static ) set ( _var_prefix "BTF" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CAMD/CMakeLists.txt b/CAMD/CMakeLists.txt index 31bd1a493..889f36882 100644 --- a/CAMD/CMakeLists.txt +++ b/CAMD/CMakeLists.txt @@ -44,7 +44,7 @@ project ( camd find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -71,17 +71,18 @@ include_directories ( Source Include ) file ( GLOB CAMD_SOURCES "Source/*.c" ) -add_library ( camd SHARED ${CAMD_SOURCES} ) +add_library ( CAMD SHARED ${CAMD_SOURCES} ) -set_target_properties ( camd PROPERTIES +set_target_properties ( CAMD PROPERTIES VERSION ${CAMD_VERSION_MAJOR}.${CAMD_VERSION_MINOR}.${CAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME camd SOVERSION ${CAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/camd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( camd +target_include_directories ( CAMD INTERFACE "$" "$" ) @@ -90,9 +91,9 @@ target_include_directories ( camd #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( camd_static STATIC ${CAMD_SOURCES} ) + add_library ( CAMD_static STATIC ${CAMD_SOURCES} ) - set_target_properties ( camd_static PROPERTIES + set_target_properties ( CAMD_static PROPERTIES VERSION ${CAMD_VERSION_MAJOR}.${CAMD_VERSION_MINOR}.${CAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -100,11 +101,11 @@ if ( NOT NSTATIC ) SOVERSION ${CAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( camd_static PROPERTIES + set_target_properties ( CAMD_static PROPERTIES OUTPUT_NAME camd_static ) endif ( ) - target_include_directories ( camd_static + target_include_directories ( CAMD_static INTERFACE "$" "$" ) @@ -114,21 +115,22 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( camd PRIVATE suitesparseconfig ) -target_include_directories ( camd PUBLIC "$" ) +target_link_libraries ( CAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( camd_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( camd_static PUBLIC suitesparseconfig ) + target_link_libraries ( CAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( camd PRIVATE m ) + target_link_libraries ( CAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( camd_static PUBLIC m ) + target_link_libraries ( CAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -138,24 +140,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS camd +install ( TARGETS CAMD EXPORT CAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS camd_static + install ( TARGETS CAMD_static EXPORT CAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT CAMDTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/CAMDTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT CAMDTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CAMD ) configure_package_config_file ( @@ -195,10 +199,10 @@ if ( DEMO ) add_executable ( camd_simple "Demo/camd_simple.c" ) # Libraries required for Demo programs - target_link_libraries ( camd_demo PUBLIC camd ) - target_link_libraries ( camd_l_demo PUBLIC camd ) - target_link_libraries ( camd_demo2 PUBLIC camd ) - target_link_libraries ( camd_simple PUBLIC camd ) + target_link_libraries ( camd_demo PUBLIC CAMD ) + target_link_libraries ( camd_l_demo PUBLIC CAMD ) + target_link_libraries ( camd_demo2 PUBLIC CAMD ) + target_link_libraries ( camd_simple PUBLIC CAMD ) else ( ) diff --git a/CAMD/Config/CAMDConfig.cmake.in b/CAMD/Config/CAMDConfig.cmake.in index 8057237b9..06e3d4cc9 100644 --- a/CAMD/Config/CAMDConfig.cmake.in +++ b/CAMD/Config/CAMDConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the CAMD include file and compiled library. # The following targets are defined: -# camd - for the shared library (if available) -# camd_static - for the static library (if available) +# SuiteSparse::CAMD - for the shared library (if available) +# SuiteSparse::CAMD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/CAMDTargets.cmake ) # The following is only for backward compatibility with FindCAMD. -set ( _target_shared camd ) -set ( _target_static camd_static ) +set ( _target_shared SuiteSparse::CAMD ) +set ( _target_static SuiteSparse::CAMD_static ) set ( _var_prefix "CAMD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CCOLAMD/CMakeLists.txt b/CCOLAMD/CMakeLists.txt index 66fa4849a..1dd1e9a25 100644 --- a/CCOLAMD/CMakeLists.txt +++ b/CCOLAMD/CMakeLists.txt @@ -44,7 +44,7 @@ project ( ccolamd find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -68,17 +68,18 @@ include_directories ( Source Include ) file ( GLOB CCOLAMD_SOURCES "Source/*.c" ) -add_library ( ccolamd SHARED ${CCOLAMD_SOURCES} ) +add_library ( CCOLAMD SHARED ${CCOLAMD_SOURCES} ) -set_target_properties ( ccolamd PROPERTIES +set_target_properties ( CCOLAMD PROPERTIES VERSION ${CCOLAMD_VERSION_MAJOR}.${CCOLAMD_VERSION_MINOR}.${CCOLAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME ccolamd SOVERSION ${CCOLAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/ccolamd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( ccolamd +target_include_directories ( CCOLAMD INTERFACE "$" "$" ) @@ -87,9 +88,9 @@ target_include_directories ( ccolamd #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( ccolamd_static STATIC ${CCOLAMD_SOURCES} ) + add_library ( CCOLAMD_static STATIC ${CCOLAMD_SOURCES} ) - set_target_properties ( ccolamd_static PROPERTIES + set_target_properties ( CCOLAMD_static PROPERTIES VERSION ${CCOLAMD_VERSION_MAJOR}.${CCOLAMD_VERSION_MINOR}.${CCOLAMD_VERSION_SUB} OUTPUT_NAME ccolamd C_STANDARD 11 @@ -97,11 +98,11 @@ if ( NOT NSTATIC ) SOVERSION ${CCOLAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( ccolamd_static PROPERTIES + set_target_properties ( CCOLAMD_static PROPERTIES OUTPUT_NAME ccolamd_static ) endif ( ) - target_include_directories ( ccolamd_static + target_include_directories ( CCOLAMD_static INTERFACE "$" "$" ) @@ -111,21 +112,22 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( ccolamd PRIVATE suitesparseconfig ) -target_include_directories ( ccolamd PUBLIC "$" ) +target_link_libraries ( CCOLAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CCOLAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( ccolamd_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CCOLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( ccolamd_static PUBLIC suitesparseconfig ) + target_link_libraries ( CCOLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( ccolamd PRIVATE m ) + target_link_libraries ( CCOLAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( ccolamd_static PUBLIC m ) + target_link_libraries ( CCOLAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -135,24 +137,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS ccolamd +install ( TARGETS CCOLAMD EXPORT CCOLAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS ccolamd_static + install ( TARGETS CCOLAMD_static EXPORT CCOLAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT CCOLAMDTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT CCOLAMDTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CCOLAMD ) configure_package_config_file ( @@ -190,8 +194,8 @@ if ( DEMO ) add_executable ( ccolamd_l_example "Demo/ccolamd_l_example.c" ) # Libraries required for Demo programs - target_link_libraries ( ccolamd_example PUBLIC ccolamd ) - target_link_libraries ( ccolamd_l_example PUBLIC ccolamd ) + target_link_libraries ( ccolamd_example PUBLIC CCOLAMD ) + target_link_libraries ( ccolamd_l_example PUBLIC CCOLAMD ) else ( ) diff --git a/CCOLAMD/Config/CCOLAMDConfig.cmake.in b/CCOLAMD/Config/CCOLAMDConfig.cmake.in index 924842f40..4152ada89 100644 --- a/CCOLAMD/Config/CCOLAMDConfig.cmake.in +++ b/CCOLAMD/Config/CCOLAMDConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the CCOLAMD include file and compiled library. # The following targets are defined: -# ccolamd - for the shared library (if available) -# ccolamd_static - for the static library (if available) +# SuiteSparse::CCOLAMD - for the shared library (if available) +# SuiteSparse::CCOLAMD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/CCOLAMDTargets.cmake ) # The following is only for backward compatibility with FindCCOLAMD. -set ( _target_shared ccolamd ) -set ( _target_static ccolamd_static ) +set ( _target_shared SuiteSparse::CCOLAMD ) +set ( _target_static SuiteSparse::CCOLAMD_static ) set ( _var_prefix "CCOLAMD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 9da73b38e..969dfa020 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -78,19 +78,19 @@ endif ( ) find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET colamd ) +if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) @@ -196,13 +196,13 @@ endif ( ) # find CAMD and CCOLAMD find_package ( CAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET camd ) + if ( NOT TARGET SuiteSparse::CAMD ) find_package ( CAMD 3.0.4 ) endif ( ) find_package ( CCOLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET ccolamd ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) find_package ( CCOLAMD 3.0.4 ) endif ( ) @@ -268,8 +268,8 @@ endif ( ) add_subdirectory ( GPU ) if ( SUITESPARSE_CUDA ) # with CUDA - set ( CHOLMOD_CUDA cholmod_cuda ${CUDA_LIBRARIES} ) - set ( CHOLMOD_CUDA_STATIC cholmod_cuda_static ${CUDA_LIBRARIES} ) + set ( CHOLMOD_CUDA CHOLMOD_CUDA ${CUDA_LIBRARIES} ) + set ( CHOLMOD_CUDA_STATIC CHOLMOD_CUDA_static ${CUDA_LIBRARIES} ) include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} ) link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" ) else ( ) @@ -304,22 +304,23 @@ file ( GLOB CHOLMOD_SOURCES "Check/cholmod_*.c" "Cholesky/cholmod_*.c" "Core/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c" "Partition/cholmod_*.c" "Supernodal/cholmod_*.c" ) -add_library ( cholmod SHARED ${CHOLMOD_SOURCES} ) +add_library ( CHOLMOD SHARED ${CHOLMOD_SOURCES} ) -set_target_properties ( cholmod PROPERTIES +set_target_properties ( CHOLMOD PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME cholmod SOVERSION ${CHOLMOD_VERSION_MAJOR} PUBLIC_HEADER "Include/cholmod.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) if ( SUITESPARSE_CUDA ) - set_target_properties ( cholmod PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( cholmod PROPERTIES POSITION_INDEPENDENT_CODE on ) + set_target_properties ( CHOLMOD PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( CHOLMOD PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) -target_include_directories ( cholmod +target_include_directories ( CHOLMOD INTERFACE "$" "$" ) @@ -328,9 +329,9 @@ target_include_directories ( cholmod #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( cholmod_static STATIC ${CHOLMOD_SOURCES} ) + add_library ( CHOLMOD_static STATIC ${CHOLMOD_SOURCES} ) - set_target_properties ( cholmod_static PROPERTIES + set_target_properties ( CHOLMOD_static PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -338,16 +339,16 @@ if ( NOT NSTATIC ) SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cholmod_static PROPERTIES + set_target_properties ( CHOLMOD_static PROPERTIES OUTPUT_NAME cholmod_static ) endif ( ) if ( SUITESPARSE_CUDA ) - set_target_properties ( cholmod_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( cholmod_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + set_target_properties ( CHOLMOD_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( CHOLMOD_static PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) - target_include_directories ( cholmod_static + target_include_directories ( CHOLMOD_static INTERFACE "$" "$" ) @@ -357,14 +358,15 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( cholmod PRIVATE suitesparseconfig ) -target_include_directories ( cholmod PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CHOLMOD PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( cholmod_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( cholmod_static PUBLIC suitesparseconfig ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) @@ -373,9 +375,9 @@ 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 ( cholmod PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS} " ) @@ -384,29 +386,29 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( cholmod PRIVATE m ) + target_link_libraries ( CHOLMOD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC m ) + target_link_libraries ( CHOLMOD_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( cholmod PRIVATE amd ) +# AMD: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::AMD ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( cholmod_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( cholmod_static PUBLIC amd ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::AMD ) endif ( ) endif ( ) -# colamd: -target_link_libraries ( cholmod PRIVATE colamd ) +# COLAMD: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::COLAMD ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( cholmod_static PUBLIC colamd_static ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::COLAMD_static ) else ( ) - target_link_libraries ( cholmod_static PUBLIC colamd ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::COLAMD ) endif ( ) endif ( ) @@ -416,9 +418,9 @@ if ( NOT NSUPERNODAL ) message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") - target_link_libraries ( cholmod PRIVATE ${BLAS_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE ${BLAS_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${BLAS_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${BLAS_LIBRARIES} ) endif ( ) include_directories ( ${BLAS_INCLUDE_DIRS} ) @@ -426,30 +428,30 @@ if ( NOT NSUPERNODAL ) message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES} ") message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS} ") message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS} ") - target_link_libraries ( cholmod PRIVATE ${LAPACK_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE ${LAPACK_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${LAPACK_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${LAPACK_LIBRARIES} ) endif ( ) include_directories ( ${LAPACK_INCLUDE_DIR} ) endif ( ) -# camd and ccolamd: +# CAMD and CCOLAMD: if ( NOT NCAMD ) - target_link_libraries ( cholmod PRIVATE camd ) + target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::CAMD ) if ( NOT NSTATIC ) - if ( TARGET camd_static ) - target_link_libraries ( cholmod_static PUBLIC camd_static ) + if ( TARGET SuiteSparse::CAMD_static ) + target_link_libraries (CHOLMOD_static PUBLIC SuiteSparse::CAMD_static ) else ( ) - target_link_libraries ( cholmod_static PUBLIC camd ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CAMD ) endif ( ) endif ( ) - target_link_libraries ( cholmod PRIVATE ccolamd ) + target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::CCOLAMD ) if ( NOT NSTATIC ) - if ( TARGET ccolamd_static ) - target_link_libraries ( cholmod_static PUBLIC ccolamd_static ) + if ( TARGET SuiteSparse::CCOLAMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CCOLAMD_static ) else ( ) - target_link_libraries ( cholmod_static PUBLIC ccolamd ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CCOLAMD ) endif ( ) endif ( ) endif ( ) @@ -461,12 +463,12 @@ if ( NOT NPARTITION ) include_directories ( SuiteSparse_metis/include ) endif ( ) -# cholmod_cuda +# CHOLMOD_CUDA if ( SUITESPARSE_CUDA ) message ( STATUS "CHOLMOD cuda: " ${CHOLMOD_CUDA} ) - target_link_libraries ( cholmod PRIVATE cholmod_cuda ) + target_link_libraries ( CHOLMOD PRIVATE CHOLMOD_CUDA ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC cholmod_cuda_static ) + target_link_libraries ( CHOLMOD_static PUBLIC CHOLMOD_CUDA_static ) endif ( ) endif ( ) @@ -476,24 +478,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS cholmod +install ( TARGETS CHOLMOD EXPORT CHOLMODTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS cholmod_static + install ( TARGETS CHOLMOD_static EXPORT CHOLMODTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT CHOLMODTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT CHOLMODTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD ) configure_package_config_file ( @@ -538,9 +542,9 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( cholmod_demo PUBLIC cholmod ${CHOLMOD_CUDA} suitesparseconfig ) - target_link_libraries ( cholmod_l_demo PUBLIC cholmod ${CHOLMOD_CUDA} suitesparseconfig ) - target_link_libraries ( cholmod_simple PUBLIC cholmod ${CHOLMOD_CUDA} ) + target_link_libraries ( cholmod_demo PUBLIC CHOLMOD ${CHOLMOD_CUDA} SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( cholmod_l_demo PUBLIC CHOLMOD ${CHOLMOD_CUDA} SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( cholmod_simple PUBLIC CHOLMOD ${CHOLMOD_CUDA} ) else ( ) diff --git a/CHOLMOD/Config/CHOLMODConfig.cmake.in b/CHOLMOD/Config/CHOLMODConfig.cmake.in index ea856c2af..0d3d61a20 100644 --- a/CHOLMOD/Config/CHOLMODConfig.cmake.in +++ b/CHOLMOD/Config/CHOLMODConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the CHOLMOD include file and compiled library. # The following targets are defined: -# cholmod - for the shared library (if available) -# cholmod_static - for the static library (if available) +# SuiteSparse::CHOLMOD - for the shared library (if available) +# SuiteSparse::CHOLMOD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -38,8 +38,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/CHOLMODTargets.cmake ) # The following is only for backward compatibility with FindCHOLMOD. -set ( _target_shared cholmod ) -set ( _target_static cholmod_static ) +set ( _target_shared SuiteSparse::CHOLMOD ) +set ( _target_static SuiteSparse::CHOLMOD_static ) set ( _var_prefix "CHOLMOD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in b/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in index 7daac669b..f1eddd932 100644 --- a/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in +++ b/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the CHOLMOD_CUDA include file and compiled library. # The following targets are defined: -# cholmod_cuda - for the shared library (if available) -# cholmod_cuda_static - for the static library (if available) +# SuiteSparse::CHOLMOD_CUDA - for the shared library (if available) +# SuiteSparse::CHOLMOD_CUDA_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -38,8 +38,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/CHOLMOD_CUDATargets.cmake ) # The following is only for backward compatibility with FindCHOLMOD_CUDA. -set ( _target_shared cholmod_cuda ) -set ( _target_static cholmod_cuda_static ) +set ( _target_shared SuiteSparse::CHOLMOD_CUDA ) +set ( _target_static SuiteSparse::CHOLMOD_CUDA_static ) set ( _var_prefix "CHOLMOD_CUDA" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CHOLMOD/GPU/CMakeLists.txt b/CHOLMOD/GPU/CMakeLists.txt index 09e60daf2..fb85c80ae 100644 --- a/CHOLMOD/GPU/CMakeLists.txt +++ b/CHOLMOD/GPU/CMakeLists.txt @@ -37,20 +37,21 @@ else ( ) file ( GLOB CHOLMOD_CUDA_SOURCES "cholmod_gpu.c" "cholmod_l_gpu.c" ) endif ( ) -add_library ( cholmod_cuda SHARED ${CHOLMOD_CUDA_SOURCES} ) +add_library ( CHOLMOD_CUDA SHARED ${CHOLMOD_CUDA_SOURCES} ) -set_target_properties ( cholmod_cuda PROPERTIES +set_target_properties ( CHOLMOD_CUDA PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 C_STANDARD_REQUIRED ON C_STANDARD 11 + OUTPUT_NAME cholmod_cuda SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( NOT NSTATIC ) - add_library ( cholmod_cuda_static STATIC ${CHOLMOD_CUDA_SOURCES} ) + add_library ( CHOLMOD_CUDA_static STATIC ${CHOLMOD_CUDA_SOURCES} ) - set_target_properties ( cholmod_cuda_static PROPERTIES + set_target_properties ( CHOLMOD_CUDA_static PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 @@ -60,7 +61,7 @@ if ( NOT NSTATIC ) SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cholmod_cuda_static PROPERTIES + set_target_properties ( CHOLMOD_CUDA_static PROPERTIES OUTPUT_NAME cholmod_cuda_static ) endif ( ) endif ( ) @@ -76,27 +77,27 @@ set ( CHOLMOD_CUDA_INCLUDES include_directories ( ${CHOLMOD_CUDA_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) -target_include_directories ( cholmod_cuda PRIVATE +target_include_directories ( CHOLMOD_CUDA PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${CHOLMOD_CUDA_INCLUDES} ) -set_target_properties ( cholmod_cuda PROPERTIES POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( cholmod_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) +set_target_properties ( CHOLMOD_CUDA PROPERTIES POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( CHOLMOD_CUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) if ( NOT NSTATIC ) -target_include_directories ( cholmod_cuda_static PRIVATE +target_include_directories ( CHOLMOD_CUDA_static PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${CHOLMOD_CUDA_INCLUDES} ) -set_target_properties ( cholmod_cuda_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) -set_target_properties ( cholmod_cuda_static PROPERTIES POSITION_INDEPENDENT_CODE on ) +set_target_properties ( CHOLMOD_CUDA_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) +set_target_properties ( CHOLMOD_CUDA_static PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) if ( SUITESPARSE_CUDA ) # this must be a PUBLIC link, not PRIVATE, so the CHOLMOD library # itself can link against these libraries - target_link_libraries ( cholmod_cuda PUBLIC CUDA::nvrtc CUDA::cudart_static + target_link_libraries ( CHOLMOD_CUDA PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_cuda_static PUBLIC CUDA::nvrtc CUDA::cudart_static + target_link_libraries ( CHOLMOD_CUDA_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) endif ( ) @@ -107,25 +108,27 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS cholmod_cuda +install ( TARGETS CHOLMOD_CUDA EXPORT CHOLMOD_CUDATargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) -install ( TARGETS cholmod_cuda_static - EXPORT CHOLMOD_CUDATargets - ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) + install ( TARGETS CHOLMOD_CUDA_static + EXPORT CHOLMOD_CUDATargets + ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT CHOLMOD_CUDATargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDATargets.cmake ) # install export target, config and version files for find_package install ( EXPORT CHOLMOD_CUDATargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD_CUDA ) configure_package_config_file ( diff --git a/COLAMD/CMakeLists.txt b/COLAMD/CMakeLists.txt index 83de40b9e..c368e6ffd 100644 --- a/COLAMD/CMakeLists.txt +++ b/COLAMD/CMakeLists.txt @@ -44,7 +44,7 @@ project ( colamd find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -68,17 +68,18 @@ include_directories ( Source Include ) file ( GLOB COLAMD_SOURCES "Source/*.c" ) -add_library ( colamd SHARED ${COLAMD_SOURCES} ) +add_library ( COLAMD SHARED ${COLAMD_SOURCES} ) -set_target_properties ( colamd PROPERTIES +set_target_properties ( COLAMD PROPERTIES VERSION ${COLAMD_VERSION_MAJOR}.${COLAMD_VERSION_MINOR}.${COLAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME colamd SOVERSION ${COLAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/colamd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( colamd +target_include_directories ( COLAMD INTERFACE "$" "$" ) @@ -87,9 +88,9 @@ target_include_directories ( colamd #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( colamd_static STATIC ${COLAMD_SOURCES} ) + add_library ( COLAMD_static STATIC ${COLAMD_SOURCES} ) - set_target_properties ( colamd_static PROPERTIES + set_target_properties ( COLAMD_static PROPERTIES VERSION ${COLAMD_VERSION_MAJOR}.${COLAMD_VERSION_MINOR}.${COLAMD_VERSION_SUB} OUTPUT_NAME colamd C_STANDARD 11 @@ -97,11 +98,11 @@ if ( NOT NSTATIC ) SOVERSION ${COLAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( colamd_static PROPERTIES + set_target_properties ( COLAMD_static PROPERTIES OUTPUT_NAME colamd_static ) endif ( ) - target_include_directories ( colamd_static + target_include_directories ( COLAMD_static INTERFACE "$" "$" ) @@ -111,21 +112,22 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( colamd PRIVATE suitesparseconfig ) -target_include_directories ( colamd PUBLIC "$" ) +target_link_libraries ( COLAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( COLAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( colamd_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( COLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( colamd_static PUBLIC suitesparseconfig ) + target_link_libraries ( COLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( colamd PRIVATE m ) + target_link_libraries ( COLAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( colamd_static PUBLIC m ) + target_link_libraries ( COLAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -135,24 +137,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS colamd +install ( TARGETS COLAMD EXPORT COLAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS colamd_static + install ( TARGETS COLAMD_static EXPORT COLAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT COLAMDTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/COLAMDTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT COLAMDTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/COLAMD ) configure_package_config_file ( @@ -190,8 +194,8 @@ if ( DEMO ) add_executable ( colamd_l_example "Demo/colamd_l_example.c" ) # Libraries required for Demo programs - target_link_libraries ( colamd_example PUBLIC colamd ) - target_link_libraries ( colamd_l_example PUBLIC colamd ) + target_link_libraries ( colamd_example PUBLIC COLAMD ) + target_link_libraries ( colamd_l_example PUBLIC COLAMD ) else ( ) diff --git a/COLAMD/Config/COLAMDConfig.cmake.in b/COLAMD/Config/COLAMDConfig.cmake.in index e3c299fd7..a9597ee57 100644 --- a/COLAMD/Config/COLAMDConfig.cmake.in +++ b/COLAMD/Config/COLAMDConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the COLAMD include file and compiled library. # The following targets are defined: -# colamd - for the shared library (if available) -# colamd_static - for the static library (if available) +# SuiteSparse::COLAMD - for the shared library (if available) +# SuiteSparse::COLAMD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/COLAMDTargets.cmake ) # The following is only for backward compatibility with FindCOLAMD. -set ( _target_shared colamd ) -set ( _target_static colamd_static ) +set ( _target_shared SuiteSparse::COLAMD ) +set ( _target_static SuiteSparse::COLAMD_static ) set ( _var_prefix "COLAMD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/CXSparse/CMakeLists.txt b/CXSparse/CMakeLists.txt index ab4738770..4adae359c 100644 --- a/CXSparse/CMakeLists.txt +++ b/CXSparse/CMakeLists.txt @@ -65,7 +65,7 @@ project ( cxsparse find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -101,17 +101,18 @@ else ( ) file ( GLOB CXSPARSE_SOURCES "Source/*.c" ) endif ( ) -add_library ( cxsparse SHARED ${CXSPARSE_SOURCES} ) +add_library ( CXSparse SHARED ${CXSPARSE_SOURCES} ) -set_target_properties ( cxsparse PROPERTIES +set_target_properties ( CXSparse PROPERTIES VERSION ${CXSPARSE_VERSION_MAJOR}.${CXSPARSE_VERSION_MINOR}.${CXSPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME cxsparse SOVERSION ${CXSPARSE_VERSION_MAJOR} PUBLIC_HEADER "Include/cs.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( cxsparse +target_include_directories ( CXSparse INTERFACE "$" "$" ) @@ -120,9 +121,9 @@ target_include_directories ( cxsparse #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( cxsparse_static STATIC ${CXSPARSE_SOURCES} ) + add_library ( CXSparse_static STATIC ${CXSPARSE_SOURCES} ) - set_target_properties ( cxsparse_static PROPERTIES + set_target_properties ( CXSparse_static PROPERTIES VERSION ${CXSPARSE_VERSION_MAJOR}.${CXSPARSE_VERSION_MINOR}.${CXSPARSE_VERSION_SUB} OUTPUT_NAME cxsparse C_STANDARD 11 @@ -130,11 +131,11 @@ if ( NOT NSTATIC ) SOVERSION ${CXSPARSE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cxsparse_static PROPERTIES + set_target_properties ( CXSparse_static PROPERTIES OUTPUT_NAME cxsparse_static ) endif ( ) - target_include_directories ( cxsparse_static + target_include_directories ( CXSparse_static INTERFACE "$" "$" ) @@ -144,21 +145,22 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( cxsparse PRIVATE suitesparseconfig ) -target_include_directories ( cxsparse PUBLIC "$" ) +target_link_libraries ( CXSparse PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CXSparse PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( cxsparse_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CXSparse_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( cxsparse_static PUBLIC suitesparseconfig ) + target_link_libraries ( CXSparse_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( cxsparse PRIVATE m ) + target_link_libraries ( CXSparse PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( cxsparse_static PUBLIC m ) + target_link_libraries ( CXSparse_static PUBLIC m ) endif ( ) endif ( ) @@ -168,24 +170,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS cxsparse +install ( TARGETS CXSparse EXPORT CXSparseTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS cxsparse_static + install ( TARGETS CXSparse_static EXPORT CXSparseTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT CXSparseTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/CXSparseTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT CXSparseTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CXSparse ) configure_package_config_file ( @@ -245,26 +249,26 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( cs_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_di_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_di_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_di_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_di_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_di_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_di_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_dl_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_dl_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_dl_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_dl_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_dl_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_dl_demo3 PUBLIC CXSparse ) if ( NOT NCOMPLEX ) - target_link_libraries ( cs_ci_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_ci_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_ci_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_ci_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_ci_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_ci_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_cl_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_cl_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_cl_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_cl_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_cl_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_cl_demo3 PUBLIC CXSparse ) if ( NOT WIN32 ) target_link_libraries ( cs_ci_demo1 PUBLIC m ) @@ -276,8 +280,8 @@ if ( DEMO ) target_link_libraries ( cs_cl_demo3 PUBLIC m ) endif ( ) - target_link_libraries ( cs_idemo PUBLIC cxsparse ) - target_link_libraries ( cs_ldemo PUBLIC cxsparse ) + target_link_libraries ( cs_idemo PUBLIC CXSparse ) + target_link_libraries ( cs_ldemo PUBLIC CXSparse ) endif ( ) else ( ) diff --git a/CXSparse/Config/CXSparseConfig.cmake.in b/CXSparse/Config/CXSparseConfig.cmake.in index c4838d376..1cb709acc 100644 --- a/CXSparse/Config/CXSparseConfig.cmake.in +++ b/CXSparse/Config/CXSparseConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the CXSparse include file and compiled library. # The following targets are defined: -# cxsparse - for the shared library (if available) -# cxsparse_static - for the static library (if available) +# SuiteSparse::CXSparse - for the shared library (if available) +# SuiteSparse::CXSparse_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/CXSparseTargets.cmake ) # The following is only for backward compatibility with FindCXSparse. -set ( _target_shared cxsparse ) -set ( _target_static cxsparse_static ) +set ( _target_shared SuiteSparse::CXSparse ) +set ( _target_static SuiteSparse::CXSparse_static ) set ( _var_prefix "CXSPARSE" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 344c556d3..f451776a3 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -220,104 +220,104 @@ target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} ) target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} ) include_directories ( ${MPFR_INCLUDE_DIR} ) -# amd: -target_link_libraries ( my PRIVATE amd ) -target_link_libraries ( my_cxx PRIVATE amd ) -if ( TARGET amd_static ) - target_link_libraries ( my_static PUBLIC amd_static ) - target_link_libraries ( my_cxx_static PUBLIC amd_static ) +# AMD: +target_link_libraries ( my PRIVATE SuiteSparse::AMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::AMD ) +if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::AMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( my_static PUBLIC amd ) - target_link_libraries ( my_cxx_static PUBLIC amd ) + target_link_libraries ( my_static PUBLIC SuiteSparse::AMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::AMD ) endif ( ) -# btf: -target_link_libraries ( my PRIVATE btf ) -target_link_libraries ( my_cxx PRIVATE btf ) -if ( TARGET btf_static ) - target_link_libraries ( my_static PUBLIC btf_static ) - target_link_libraries ( my_cxx_static PUBLIC btf_static ) +# BTF: +target_link_libraries ( my PRIVATE SuiteSparse::BTF ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::BTF ) +if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::BTF_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::BTF_static ) else ( ) - target_link_libraries ( my_static PUBLIC btf ) - target_link_libraries ( my_cxx_static PUBLIC btf ) + target_link_libraries ( my_static PUBLIC SuiteSparse::BTF ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::BTF ) endif ( ) -# camd: -target_link_libraries ( my PRIVATE camd ) -target_link_libraries ( my_cxx PRIVATE camd ) -if ( TARGET camd_static ) - target_link_libraries ( my_static PUBLIC camd_static ) - target_link_libraries ( my_cxx_static PUBLIC camd_static ) +# CAMD: +target_link_libraries ( my PRIVATE SuiteSparse::CAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CAMD ) +if ( TARGET SuiteSparse::CAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CAMD_static ) else ( ) - target_link_libraries ( my_static PUBLIC camd ) - target_link_libraries ( my_cxx_static PUBLIC camd ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CAMD ) endif ( ) -# ccolamd: -target_link_libraries ( my PRIVATE ccolamd ) -target_link_libraries ( my_cxx PRIVATE ccolamd ) -if ( TARGET ccolamd_static ) - target_link_libraries ( my_static PUBLIC ccolamd_static ) - target_link_libraries ( my_cxx_static PUBLIC ccolamd_static ) +# CCOLAMD: +target_link_libraries ( my PRIVATE SuiteSparse::CCOLAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CCOLAMD ) +if ( TARGET SuiteSparse::CCOLAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CCOLAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CCOLAMD_static ) else ( ) - target_link_libraries ( my_static PUBLIC ccolamd ) - target_link_libraries ( my_cxx_static PUBLIC ccolamd ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CCOLAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CCOLAMD ) endif ( ) -# cholmod: -target_link_libraries ( my PRIVATE cholmod ) -target_link_libraries ( my_cxx PRIVATE cholmod ) -if ( TARGET cholmod_static ) - target_link_libraries ( my_static PUBLIC cholmod_static ) - target_link_libraries ( my_cxx_static PUBLIC cholmod_static ) +# CHOLMOD: +target_link_libraries ( my PRIVATE SuiteSparse::CHOLMOD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CHOLMOD ) +if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CHOLMOD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CHOLMOD_static ) else ( ) - target_link_libraries ( my_static PUBLIC cholmod ) - target_link_libraries ( my_cxx_static PUBLIC cholmod ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CHOLMOD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CHOLMOD ) endif ( ) -# colamd: -target_link_libraries ( my PRIVATE colamd ) -target_link_libraries ( my_cxx PRIVATE colamd ) -if ( TARGET colamd_static ) - target_link_libraries ( my_static PUBLIC colamd_static ) - target_link_libraries ( my_cxx_static PUBLIC colamd_static ) +# COLAMD: +target_link_libraries ( my PRIVATE SuiteSparse::COLAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::COLAMD ) +if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::COLAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::COLAMD_static ) else ( ) - target_link_libraries ( my_static PUBLIC colamd ) - target_link_libraries ( my_cxx_static PUBLIC colamd ) + target_link_libraries ( my_static PUBLIC SuiteSparse::COLAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::COLAMD ) endif ( ) -# cxsparse: -target_link_libraries ( my PRIVATE cxsparse ) -target_link_libraries ( my_cxx PRIVATE cxsparse ) -if ( TARGET cxsparse_static ) - target_link_libraries ( my_static PUBLIC cxsparse_static ) - target_link_libraries ( my_cxx_static PUBLIC cxsparse_static ) +# CXSparse: +target_link_libraries ( my PRIVATE SuiteSparse::CXSparse ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CXSparse ) +if ( TARGET SuiteSparse::CXSparse_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CXSparse_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CXSparse_static ) else ( ) - target_link_libraries ( my_static PUBLIC cxsparse ) - target_link_libraries ( my_cxx_static PUBLIC cxsparse ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CXSparse ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CXSparse ) endif ( ) -# gpuqrengine: -target_link_libraries ( my PRIVATE gpuqrengine ) -target_link_libraries ( my_cxx PRIVATE gpuqrengine ) -if ( TARGET gpuqrengine_static ) - target_link_libraries ( my_static PUBLIC gpuqrengine_static ) - target_link_libraries ( my_cxx_static PUBLIC gpuqrengine_static ) +# GPUQREngine: +target_link_libraries ( my PRIVATE SuiteSparse::GPUQREngine ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPUQREngine ) +if ( TARGET SuiteSparse::GPUQREngine_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine_static ) else ( ) - target_link_libraries ( my_static PUBLIC gpuqrengine ) - target_link_libraries ( my_cxx_static PUBLIC gpuqrengine ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine ) endif ( ) # GraphBLAS: -if ( TARGET graphblas ) - target_link_libraries ( my PRIVATE graphblas ) - target_link_libraries ( my_cxx PRIVATE graphblas ) - if ( TARGET graphblas_static ) - target_link_libraries ( my_static PUBLIC graphblas_static ) - target_link_libraries ( my_cxx_static PUBLIC graphblas_static ) +if ( TARGET SuiteSparse::GraphBLAS ) + target_link_libraries ( my PRIVATE SuiteSparse::GraphBLAS ) + target_link_libraries ( my_cxx PRIVATE SuiteSparse::GraphBLAS ) + if ( TARGET SuiteSparse::GraphBLAS_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GraphBLAS_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GraphBLAS_static ) else ( ) - target_link_libraries ( my_static PUBLIC graphblas ) - target_link_libraries ( my_cxx_static PUBLIC graphblas ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GraphBLAS ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GraphBLAS ) endif ( ) else ( ) target_compile_definitions ( my PRIVATE NO_GRAPHBLAS ) @@ -326,114 +326,114 @@ else ( ) target_compile_definitions ( my_cxx_static PRIVATE NO_GRAPHBLAS ) endif ( ) -# klu: -target_link_libraries ( my PRIVATE klu ) -target_link_libraries ( my_cxx PRIVATE klu ) -if ( TARGET klu_static ) - target_link_libraries ( my_static PUBLIC klu_static ) - target_link_libraries ( my_cxx_static PUBLIC klu_static ) +# KLU: +target_link_libraries ( my PRIVATE SuiteSparse::KLU ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::KLU ) +if ( TARGET SuiteSparse::KLU_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_static ) else ( ) - target_link_libraries ( my_static PUBLIC klu ) - target_link_libraries ( my_cxx_static PUBLIC klu ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU ) endif ( ) -# klu_cholmod: -target_link_libraries ( my PRIVATE klu_cholmod ) -target_link_libraries ( my_cxx PRIVATE klu_cholmod ) -if ( TARGET klu_cholmod_static ) - target_link_libraries ( my_static PUBLIC klu_cholmod_static ) - target_link_libraries ( my_cxx_static PUBLIC klu_cholmod_static ) +# KLU_CHOLMOD: +target_link_libraries ( my PRIVATE SuiteSparse::KLU_CHOLMOD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::KLU_CHOLMOD ) +if ( TARGET SuiteSparse::KLU_CHOLMOD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_CHOLMOD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_CHOLMOD_static ) else ( ) - target_link_libraries ( my_static PUBLIC klu_cholmod ) - target_link_libraries ( my_cxx_static PUBLIC klu_cholmod ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_CHOLMOD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_CHOLMOD ) endif ( ) -# ldl: -target_link_libraries ( my PRIVATE ldl ) -target_link_libraries ( my_cxx PRIVATE ldl ) -if ( TARGET ldl_static ) - target_link_libraries ( my_static PUBLIC ldl_static ) - target_link_libraries ( my_cxx_static PUBLIC ldl_static ) +# LDL: +target_link_libraries ( my PRIVATE SuiteSparse::LDL ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::LDL ) +if ( TARGET SuiteSparse::LDL_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::LDL_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::LDL_static ) else ( ) - target_link_libraries ( my_static PUBLIC ldl ) - target_link_libraries ( my_cxx_static PUBLIC ldl ) + target_link_libraries ( my_static PUBLIC SuiteSparse::LDL ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::LDL ) endif ( ) -# mongoose: -target_link_libraries ( my PRIVATE mongoose ) -target_link_libraries ( my_cxx PRIVATE mongoose ) -if ( TARGET mongoose_static ) - target_link_libraries ( my_static PUBLIC mongoose_static ) - target_link_libraries ( my_cxx_static PUBLIC mongoose_static ) +# Mongoose: +target_link_libraries ( my PRIVATE SuiteSparse::Mongoose ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::Mongoose ) +if ( TARGET SuiteSparse::Mongoose_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::Mongoose_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::Mongoose_static ) else ( ) - target_link_libraries ( my_static PUBLIC mongoose ) - target_link_libraries ( my_cxx_static PUBLIC mongoose ) + target_link_libraries ( my_static PUBLIC SuiteSparse::Mongoose ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::Mongoose ) endif ( ) -# rbio: -target_link_libraries ( my PRIVATE rbio ) -target_link_libraries ( my_cxx PRIVATE rbio ) -if ( TARGET rbio_static ) - target_link_libraries ( my_static PUBLIC rbio_static ) - target_link_libraries ( my_cxx_static PUBLIC rbio_static ) +# RBio: +target_link_libraries ( my PRIVATE SuiteSparse::RBio ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::RBio ) +if ( TARGET SuiteSparse::RBio_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::RBio_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::RBio_static ) else ( ) - target_link_libraries ( my_static PUBLIC rbio ) - target_link_libraries ( my_cxx_static PUBLIC rbio ) + target_link_libraries ( my_static PUBLIC SuiteSparse::RBio ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::RBio ) endif ( ) -# spex: -target_link_libraries ( my PRIVATE spex ) -target_link_libraries ( my_cxx PRIVATE spex ) -if ( TARGET spex_static ) - target_link_libraries ( my_static PUBLIC spex_static ) - target_link_libraries ( my_cxx_static PUBLIC spex_static ) +# SPEX: +target_link_libraries ( my PRIVATE SuiteSparse::SPEX ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SPEX ) +if ( TARGET SuiteSparse::SPEX_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPEX_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPEX_static ) else ( ) - target_link_libraries ( my_static PUBLIC spex ) - target_link_libraries ( my_cxx_static PUBLIC spex ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPEX ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPEX ) endif ( ) -# spqr: -target_link_libraries ( my PRIVATE spqr ) -target_link_libraries ( my_cxx PRIVATE spqr ) -if ( TARGET spqr_static ) - target_link_libraries ( my_static PUBLIC spqr_static ) - target_link_libraries ( my_cxx_static PUBLIC spqr_static ) +# SPQR: +target_link_libraries ( my PRIVATE SuiteSparse::SPQR ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SPQR ) +if ( TARGET SuiteSparse::SPQR_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPQR_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPQR_static ) else ( ) - target_link_libraries ( my_static PUBLIC spqr ) - target_link_libraries ( my_cxx_static PUBLIC spqr ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPQR ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPQR ) endif ( ) -# suitesparseconfig: -target_link_libraries ( my PRIVATE suitesparseconfig ) -target_link_libraries ( my_cxx PRIVATE suitesparseconfig ) -if ( TARGET suitesparseconfig_static ) - target_link_libraries ( my_static PUBLIC suitesparseconfig_static ) - target_link_libraries ( my_cxx_static PUBLIC suitesparseconfig_static ) +# SuiteSparseConfig: +target_link_libraries ( my PRIVATE SuiteSparse::SuiteSparseConfig ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SuiteSparseConfig ) +if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( my_static PUBLIC suitesparseconfig ) - target_link_libraries ( my_cxx_static PUBLIC suitesparseconfig ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) -# suitesparse_gpuruntime: -target_link_libraries ( my PRIVATE suitesparse_gpuruntime ) -target_link_libraries ( my_cxx PRIVATE suitesparse_gpuruntime ) -if ( TARGET suitesparse_gpuruntime_static ) - target_link_libraries ( my_static PUBLIC suitesparse_gpuruntime_static ) - target_link_libraries ( my_cxx_static PUBLIC suitesparse_gpuruntime_static ) +# GPURuntime: +target_link_libraries ( my PRIVATE SuiteSparse::GPURuntime ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPURuntime ) +if ( TARGET SuiteSparse::GPURuntime_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime_static ) else ( ) - target_link_libraries ( my_static PUBLIC suitesparse_gpuruntime ) - target_link_libraries ( my_cxx_static PUBLIC suitesparse_gpuruntime ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime ) 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 ) +# 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 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/Example/Include/my.h b/Example/Include/my.h index 27eb10903..f2e2bb89e 100644 --- a/Example/Include/my.h +++ b/Example/Include/my.h @@ -11,10 +11,10 @@ // file, since it is constructed from Config/my.h.in by cmake. // version and date for example user library -#define MY_DATE "June 16, 2023" +#define MY_DATE "July FIXME, 2023" #define MY_MAJOR_VERSION 1 -#define MY_MINOR_VERSION 2 -#define MY_PATCH_VERSION 5 +#define MY_MINOR_VERSION 3 +#define MY_PATCH_VERSION 0 #ifdef __cplusplus extern "C" { diff --git a/GPUQREngine/CMakeLists.txt b/GPUQREngine/CMakeLists.txt index 1c96b4a90..1499bf64d 100644 --- a/GPUQREngine/CMakeLists.txt +++ b/GPUQREngine/CMakeLists.txt @@ -57,14 +57,14 @@ endif ( ) # for the library itself find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) if ( SUITESPARSE_CUDA ) find_package ( SuiteSparse_GPURuntime 2.0.4 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/build NO_DEFAULT_PATH ) - if ( NOT TARGET suitesparse_gpuruntime ) + if ( NOT TARGET SuiteSparse::GPURuntime ) find_package ( SuiteSparse_GPURuntime 2.0.4 REQUIRED ) endif ( ) endif ( ) @@ -76,37 +76,37 @@ if ( DEMO AND DEMO_OK ) # for the demo only: find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET amd ) + if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 ) endif ( ) find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET colamd ) + if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 ) endif ( ) find_package ( CAMD 3.0.3 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET camd ) + if ( NOT TARGET SuiteSparse::CAMD ) find_package ( CAMD 3.0.3 ) endif ( ) find_package ( CCOLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET ccolamd ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) find_package ( CCOLAMD 3.0.4 ) endif ( ) find_package ( CHOLMOD 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) find_package ( CHOLMOD 4.0.4 ) endif ( ) find_package ( CHOLMOD_CUDA 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod_cuda ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) find_package ( CHOLMOD_CUDA 4.0.4 ) endif ( ) endif ( ) @@ -153,32 +153,33 @@ include_directories ( ${GPUQRENGINE_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) # dynamic gpuqrengine library properties #------------------------------------------------------------------------------- -add_library ( gpuqrengine SHARED ${GPUQRENGINE_SOURCES} ) +add_library ( GPUQREngine SHARED ${GPUQRENGINE_SOURCES} ) -set_target_properties ( gpuqrengine PROPERTIES +set_target_properties ( GPUQREngine PROPERTIES VERSION ${GPUQRENGINE_VERSION_MAJOR}.${GPUQRENGINE_VERSION_MINOR}.${GPUQRENGINE_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON + OUTPUT_NAME gpuqrengine SOVERSION ${GPUQRENGINE_VERSION_MAJOR} PUBLIC_HEADER "Include/GPUQREngine.hpp" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( gpuqrengine PRIVATE +target_include_directories ( GPUQREngine PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${GPUQRENGINE_INCLUDES} - $ ) + $ ) if ( SUITESPARSE_CUDA ) - target_include_directories ( gpuqrengine PRIVATE - $ ) + target_include_directories ( GPUQREngine PRIVATE + $ ) - set_target_properties ( gpuqrengine PROPERTIES POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( gpuqrengine PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) - target_link_libraries ( gpuqrengine PRIVATE CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPUQREngine PROPERTIES POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( GPUQREngine PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + target_link_libraries ( GPUQREngine PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) -target_include_directories ( gpuqrengine +target_include_directories ( GPUQREngine INTERFACE "$" "$" ) @@ -187,9 +188,9 @@ target_include_directories ( gpuqrengine #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( gpuqrengine_static STATIC ${GPUQRENGINE_SOURCES} ) + add_library ( GPUQREngine_static STATIC ${GPUQRENGINE_SOURCES} ) - set_target_properties ( gpuqrengine_static PROPERTIES + set_target_properties ( GPUQREngine_static PROPERTIES VERSION ${GPUQRENGINE_VERSION_MAJOR}.${GPUQRENGINE_VERSION_MINOR}.${GPUQRENGINE_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON @@ -197,26 +198,26 @@ if ( NOT NSTATIC ) SOVERSION ${GPUQRENGINE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( gpuqrengine_static PROPERTIES + set_target_properties ( GPUQREngine_static PROPERTIES OUTPUT_NAME gpuqrengine_static ) endif ( ) - target_include_directories ( gpuqrengine_static PRIVATE + target_include_directories ( GPUQREngine_static PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${GPUQRENGINE_INCLUDES} - $ ) + $ ) if ( SUITESPARSE_CUDA ) - target_include_directories ( gpuqrengine_static PRIVATE - $ ) + target_include_directories ( GPUQREngine_static PRIVATE + $ ) - set_target_properties ( gpuqrengine_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( gpuqrengine_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_link_libraries ( gpuqrengine_static PUBLIC CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPUQREngine_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( GPUQREngine_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + target_link_libraries ( GPUQREngine_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) - target_include_directories ( gpuqrengine_static + target_include_directories ( GPUQREngine_static INTERFACE "$" "$" ) endif ( ) @@ -227,24 +228,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS gpuqrengine +install ( TARGETS GPUQREngine EXPORT GPUQREngineTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS gpuqrengine_static + install ( TARGETS GPUQREngine_static EXPORT GPUQREngineTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT GPUQREngineTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT GPUQREngineTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GPUQREngine ) configure_package_config_file ( @@ -280,10 +283,10 @@ if ( DEMO AND DEMO_OK ) add_executable ( gpuqrengine_demo "Demo/gpuqrengine_demo.cpp" ) # Libraries required for Demo programs - target_link_libraries ( gpuqrengine_demo PUBLIC gpuqrengine - cholmod amd colamd - camd ccolamd cholmod_cuda - suitesparse_gpuruntime suitesparseconfig ) + target_link_libraries ( gpuqrengine_demo PUBLIC GPUQREngine + SuiteSparse::CHOLMOD SuiteSparse::AMD SuiteSparse::COLAMD + SuiteSparse::CAMD SuiteSparse::CCOLAMD SuiteSparse::CHOLMOD_CUDA + SuiteSparse::GPURuntime SuiteSparse::SuiteSparseConfig ) else ( ) diff --git a/GPUQREngine/Config/GPUQREngineConfig.cmake.in b/GPUQREngine/Config/GPUQREngineConfig.cmake.in index 8533ab443..b0bd24f56 100644 --- a/GPUQREngine/Config/GPUQREngineConfig.cmake.in +++ b/GPUQREngine/Config/GPUQREngineConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the GPUQREngine include file and compiled library. # The following targets are defined: -# gpuqrengine - for the shared library (if available) -# gpuqrengine_static - for the static library (if available) +# SuiteSparse::GPUQREngine - for the shared library (if available) +# SuiteSparse::GPUQREngine_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/GPUQREngineTargets.cmake ) # The following is only for backward compatibility with FindGPUQREngine. -set ( _target_shared gpuqrengine ) -set ( _target_static gpuqrengine_static ) +set ( _target_shared SuiteSparse::GPUQREngine ) +set ( _target_static SuiteSparse::GPUQREngine_static ) set ( _var_prefix "GPUQRENGINE" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index c6c341adb..0b3366871 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -229,28 +229,29 @@ else ( ) endif ( ) endif ( ) -add_library ( graphblas SHARED ${GRAPHBLAS_SOURCES} ) +add_library ( GraphBLAS SHARED ${GRAPHBLAS_SOURCES} ) -set_target_properties ( graphblas PROPERTIES +set_target_properties ( GraphBLAS PROPERTIES VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB} + OUTPUT_NAME graphblas SOVERSION ${GraphBLAS_VERSION_MAJOR} C_STANDARD 11 C_STANDARD_REQUIRED ON PUBLIC_HEADER "Include/GraphBLAS.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( graphblas +target_include_directories ( GraphBLAS INTERFACE "$" "$" ) if ( SUITESPARSE_CUDA ) - add_dependencies ( graphblas graphblascuda ) -# add_dependencies ( graphblas rmm_wrap ) + add_dependencies ( GraphBLAS graphblascuda ) +# add_dependencies ( GraphBLAS rmm_wrap ) endif ( ) if ( WIN32 ) # Compiling the graphblas dll on Windows: export the dll symbols - target_compile_definitions ( graphblas PRIVATE GB_DLL_EXPORT ) + target_compile_definitions ( GraphBLAS PRIVATE GB_DLL_EXPORT ) endif ( ) #------------------------------------------------------------------------------- @@ -259,9 +260,9 @@ endif ( ) if ( NOT NSTATIC ) - add_library ( graphblas_static STATIC ${GRAPHBLAS_SOURCES} ) + add_library ( GraphBLAS_static STATIC ${GRAPHBLAS_SOURCES} ) - set_target_properties ( graphblas_static PROPERTIES + set_target_properties ( GraphBLAS_static PROPERTIES VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB} OUTPUT_NAME graphblas SOVERSION ${GraphBLAS_VERSION_MAJOR} @@ -269,17 +270,17 @@ if ( NOT NSTATIC ) C_STANDARD_REQUIRED ON ) if ( MSVC ) - set_target_properties ( graphblas_static PROPERTIES + set_target_properties ( GraphBLAS_static PROPERTIES OUTPUT_NAME graphblas_static ) endif ( ) - target_include_directories ( graphblas_static + target_include_directories ( GraphBLAS_static INTERFACE "$" "$" ) if ( SUITESPARSE_CUDA ) - add_dependencies ( graphblas_static graphblascuda ) -# add_dependencies ( graphblas_static rmm_wrap ) + add_dependencies ( GraphBLAS_static graphblascuda ) +# add_dependencies ( GraphBLAS_static rmm_wrap ) endif ( ) endif ( ) @@ -295,9 +296,9 @@ if ( NOT GBNCPUFEAT ) check_include_file ( dlfcn.h HAVE_DLFCN_H ) if ( HAVE_DLFCN_H ) message ( STATUS "cpu_feautures has dlfcn.h" ) - target_compile_definitions ( graphblas PRIVATE HAVE_DLFCN_H ) + target_compile_definitions ( GraphBLAS PRIVATE HAVE_DLFCN_H ) if ( NOT NSTATIC ) - target_compile_definitions ( graphblas_static PRIVATE HAVE_DLFCN_H ) + target_compile_definitions ( GraphBLAS_static PRIVATE HAVE_DLFCN_H ) endif ( ) else ( ) message ( STATUS "cpu_feautures without dlfcn.h" ) @@ -305,9 +306,9 @@ if ( NOT GBNCPUFEAT ) check_symbol_exists ( getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL ) if ( HAVE_STRONG_GETAUXVAL ) message ( STATUS "cpu_feautures has getauxval from sys/auxv.h" ) - target_compile_definitions ( graphblas PRIVATE HAVE_STRONG_GETAUXVAL ) + target_compile_definitions ( GraphBLAS PRIVATE HAVE_STRONG_GETAUXVAL ) if ( NOT NSTATIC ) - target_compile_definitions ( graphblas_static PRIVATE HAVE_STRONG_GETAUXVAL ) + target_compile_definitions ( GraphBLAS_static PRIVATE HAVE_STRONG_GETAUXVAL ) endif ( ) else ( ) message ( STATUS "cpu_feautures doesn't have getauxval from sys/auxv.h" ) @@ -322,26 +323,26 @@ endif ( ) # libm: if ( NOT WIN32 ) set ( GB_M "m" ) - target_link_libraries ( graphblas PRIVATE m ) + target_link_libraries ( GraphBLAS PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC m ) + target_link_libraries ( GraphBLAS_static PUBLIC m ) endif ( ) endif ( ) # libdl if ( NOT WIN32 ) - target_link_libraries ( graphblas PRIVATE dl ) + target_link_libraries ( GraphBLAS PRIVATE dl ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC dl ) + target_link_libraries ( GraphBLAS_static PUBLIC dl ) endif ( ) endif ( ) # atomic include ( SuiteSparseAtomic ) if ( LIBATOMIC_REQUIRED ) - target_link_libraries ( graphblas PRIVATE atomic ) + target_link_libraries ( GraphBLAS PRIVATE atomic ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC atomic ) + target_link_libraries ( GraphBLAS_static PUBLIC atomic ) endif ( ) endif ( ) @@ -353,15 +354,15 @@ if ( OPENMP_FOUND ) message ( STATUS "CMAKE OpenMP libraries: ${OpenMP_C_LIBRARIES}" ) message ( STATUS "CMAKE OpenMP include: ${OpenMP_C_INCLUDE_DIRS}" ) # revert to ${OpenMP_C_LIBRARIES}: - target_link_libraries ( graphblas PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( GraphBLAS PRIVATE ${OpenMP_C_LIBRARIES} ) # cannot use OpenMP::OpenMP_C because the JIT is configured with # LINK_LIBRARIES. Those are -l lists passed directly to the # C compiler, and this is converted into "-lOpenMP::OpenMP_C". # So this breaks: - # target_link_libraries ( graphblas PRIVATE OpenMP::OpenMP_C ) + # target_link_libraries ( GraphBLAS PRIVATE OpenMP::OpenMP_C ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC ${OpenMP_C_LIBRARIES} ) - # target_link_libraries ( graphblas_static PUBLIC OpenMP::OpenMP_C ) + target_link_libraries ( GraphBLAS_static PUBLIC ${OpenMP_C_LIBRARIES} ) + # target_link_libraries ( GraphBLAS_static PUBLIC OpenMP::OpenMP_C ) endif ( ) message ( STATUS "CMAKE OpenMP C flags: ${OpenMP_C_FLAGS}" ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) @@ -387,15 +388,15 @@ else ( ) endif ( ) # get the current library list, before linking with cuda and rmm -get_target_property ( GB_CMAKE_LIBRARIES graphblas LINK_LIBRARIES ) +get_target_property ( GB_CMAKE_LIBRARIES GraphBLAS LINK_LIBRARIES ) if ( NOT GB_CMAKE_LIBRARIES ) set ( GB_CMAKE_LIBRARIES "" ) endif ( ) if ( SUITESPARSE_CUDA ) - target_link_libraries ( graphblas PRIVATE ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( GraphBLAS PRIVATE ${GB_CUDA} ${GB_RMM} ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( GraphBLAS_static PUBLIC ${GB_CUDA} ${GB_RMM} ) endif ( ) endif ( ) @@ -431,17 +432,17 @@ if ( DEMO ) add_executable ( gauss_demo "Demo/Program/gauss_demo.c" ) # Libraries required for Demo programs - target_link_libraries ( openmp_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( openmp2_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( complex_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( kron_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( openmp_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( openmp2_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( complex_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( kron_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( simple_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( wildtype_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( reduce_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( import_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( wathen_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( context_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( gauss_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( wildtype_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( reduce_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( import_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( wathen_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( context_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( gauss_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) if ( OPENMP_FOUND ) target_link_libraries ( openmp_demo PUBLIC OpenMP::OpenMP_C ) target_link_libraries ( openmp2_demo PUBLIC OpenMP::OpenMP_C ) @@ -462,7 +463,7 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS graphblas +install ( TARGETS GraphBLAS EXPORT GraphBLASTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} @@ -470,17 +471,19 @@ install ( TARGETS graphblas PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS graphblas_static + install ( TARGETS GraphBLAS_static EXPORT GraphBLASTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT GraphBLASTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASTargets.cmake ) # install export target and config for find_package install ( EXPORT GraphBLASTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GraphBLAS ) configure_package_config_file ( diff --git a/GraphBLAS/CUDA/CMakeLists.txt b/GraphBLAS/CUDA/CMakeLists.txt index 05ffe03d2..1195a9e0c 100644 --- a/GraphBLAS/CUDA/CMakeLists.txt +++ b/GraphBLAS/CUDA/CMakeLists.txt @@ -180,14 +180,14 @@ set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "52;75;80 include(GoogleTest) -add_dependencies(graphblascuda_test graphblas) +add_dependencies(graphblascuda_test GraphBLAS) add_dependencies(graphblascuda_test graphblascuda) add_dependencies(graphblascuda_test gtest_main) add_dependencies(graphblascuda_test rmm_wrap) target_link_libraries(graphblascuda_test PUBLIC - graphblas + GraphBLAS graphblascuda rmm_wrap CUDA::cudart_static diff --git a/GraphBLAS/Config/GB_config.h b/GraphBLAS/Config/GB_config.h index 17787706e..26b43558d 100644 --- a/GraphBLAS/Config/GB_config.h +++ b/GraphBLAS/Config/GB_config.h @@ -15,18 +15,18 @@ // GB_C_COMPILER: the C compiler used to compile GraphBLAS: #ifndef GB_C_COMPILER -#define GB_C_COMPILER "/usr/bin/cc" +#define GB_C_COMPILER "C:/msys64/mingw64/bin/cc.exe" #endif // GB_C_FLAGS: the C compiler flags used to compile GraphBLAS. Used // for compiling and linking: #ifndef GB_C_FLAGS -#define GB_C_FLAGS " -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC " +#define GB_C_FLAGS " -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp " #endif // GB_C_LINK_FLAGS: the flags passed to the C compiler for the link phase: #ifndef GB_C_LINK_FLAGS -#define GB_C_LINK_FLAGS " -shared " +#define GB_C_LINK_FLAGS "" #endif // GB_LIB_PREFIX: library prefix (lib for Linux/Unix/Mac, empty for Windows): @@ -36,12 +36,12 @@ // GB_LIB_SUFFIX: library suffix (.so for Linux/Unix, .dylib for Mac, etc): #ifndef GB_LIB_SUFFIX -#define GB_LIB_SUFFIX ".so" +#define GB_LIB_SUFFIX ".dll" #endif // GB_OBJ_SUFFIX: object suffix (.o for Linux/Unix/Mac, .obj for Windows): #ifndef GB_OBJ_SUFFIX -#define GB_OBJ_SUFFIX ".o" +#define GB_OBJ_SUFFIX ".obj" #endif // GB_OMP_INC: -I includes for OpenMP, if in use by GraphBLAS: @@ -57,12 +57,12 @@ // GB_C_LIBRARIES: libraries to link with when using direct compile/link: #ifndef GB_C_LIBRARIES -#define GB_C_LIBRARIES " -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so" +#define GB_C_LIBRARIES " C:/msys64/mingw64/lib/libgomp.dll.a C:/msys64/mingw64/lib/libmingwthrd.a C:/msys64/mingw64/lib/libmingwthrd.a" #endif // GB_CMAKE_LIBRARIES: libraries to link with when using cmake #ifndef GB_CMAKE_LIBRARIES -#define GB_CMAKE_LIBRARIES "m;dl;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so" +#define GB_CMAKE_LIBRARIES "C:/msys64/mingw64/lib/libgomp.dll.a;C:/msys64/mingw64/lib/libmingwthrd.a;C:/msys64/mingw64/lib/libmingwthrd.a" #endif #endif diff --git a/GraphBLAS/Config/GraphBLASConfig.cmake.in b/GraphBLAS/Config/GraphBLASConfig.cmake.in index babfcd4a2..0f9241834 100644 --- a/GraphBLAS/Config/GraphBLASConfig.cmake.in +++ b/GraphBLAS/Config/GraphBLASConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the GraphBLAS include file and compiled library. # The following targets are defined: -# graphblas - for the shared library (if available) -# graphblas_static - for the static library (if available) +# SuiteSparse::GraphBLAS - for the shared library (if available) +# SuiteSparse::GraphBLAS_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/GraphBLASTargets.cmake ) # The following is only for backward compatibility with FindGraphBLAS. -set ( _target_shared graphblas ) -set ( _target_static graphblas_static ) +set ( _target_shared SuiteSparse::GraphBLAS ) +set ( _target_static SuiteSparse::GraphBLAS_static ) set ( _var_prefix "GRAPHBLAS" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index 34940a6c3..5fcac82a4 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -45,24 +45,24 @@ project ( klu find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( BTF 2.0.4 PATHS ${CMAKE_SOURCE_DIR}/../BTF/build NO_DEFAULT_PATH ) -if ( NOT TARGET btf ) +if ( NOT TARGET SuiteSparse::BTF ) find_package ( BTF 2.0.4 REQUIRED ) endif ( ) find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET colamd ) +if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) @@ -72,13 +72,13 @@ if ( NOT NCHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) find_package ( CHOLMOD 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) find_package ( CHOLMOD 4.0.4 ) endif ( ) find_package ( CHOLMOD_CUDA 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod_cuda ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) find_package ( CHOLMOD_CUDA 4.0.4 ) endif ( ) @@ -86,13 +86,13 @@ if ( NOT NCHOLMOD ) # CCOLAMD are optional, but must be found if CHOLMOD was built with them. find_package ( CAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET camd ) + if ( NOT TARGET SuiteSparse::CAMD ) find_package ( CAMD 3.0.4 ) endif ( ) find_package ( CCOLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET ccolamd ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) find_package ( CCOLAMD 3.0.4 ) endif ( ) @@ -133,17 +133,18 @@ include_directories ( Source Include User ) file ( GLOB KLU_SOURCES "Source/*.c" ) -add_library ( klu SHARED ${KLU_SOURCES} ) +add_library ( KLU SHARED ${KLU_SOURCES} ) -set_target_properties ( klu PROPERTIES +set_target_properties ( KLU PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME klu SOVERSION ${KLU_VERSION_MAJOR} PUBLIC_HEADER "Include/klu.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( klu +target_include_directories ( KLU INTERFACE "$" "$" ) @@ -152,9 +153,9 @@ target_include_directories ( klu #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( klu_static STATIC ${KLU_SOURCES} ) + add_library ( KLU_static STATIC ${KLU_SOURCES} ) - set_target_properties ( klu_static PROPERTIES + set_target_properties ( KLU_static PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -162,11 +163,11 @@ if ( NOT NSTATIC ) SOVERSION ${KLU_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( klu_static PROPERTIES + set_target_properties ( KLU_static PROPERTIES OUTPUT_NAME klu_static ) endif ( ) - target_include_directories ( klu_static + target_include_directories ( KLU_static INTERFACE "$" "$" ) @@ -180,23 +181,24 @@ if ( NOT NCHOLMOD ) file ( GLOB KLU_CHOLMOD_SOURCES "User/*.c" ) - add_library ( klu_cholmod SHARED ${KLU_CHOLMOD_SOURCES} ) + add_library ( KLU_CHOLMOD SHARED ${KLU_CHOLMOD_SOURCES} ) - set_target_properties ( klu_cholmod PROPERTIES + set_target_properties ( KLU_CHOLMOD PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME klu_cholmod SOVERSION ${KLU_VERSION_MAJOR} PUBLIC_HEADER "User/klu_cholmod.h" ) - target_include_directories ( klu_cholmod + target_include_directories ( KLU_CHOLMOD INTERFACE "$" "$" ) if ( NOT NSTATIC ) - add_library ( klu_cholmod_static STATIC ${KLU_CHOLMOD_SOURCES} ) + add_library ( KLU_CHOLMOD_static STATIC ${KLU_CHOLMOD_SOURCES} ) - set_target_properties ( klu_cholmod_static PROPERTIES + set_target_properties ( KLU_CHOLMOD_static PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -204,11 +206,11 @@ if ( NOT NCHOLMOD ) SOVERSION ${KLU_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( klu_cholmod_static PROPERTIES + set_target_properties ( KLU_CHOLMOD_static PROPERTIES OUTPUT_NAME klu_cholmod_static ) endif ( ) - target_include_directories ( klu_cholmod_static + target_include_directories ( KLU_CHOLMOD_static INTERFACE "$" "$" ) @@ -220,92 +222,92 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( klu PRIVATE suitesparseconfig ) +# SuiteSparseConfig: +target_link_libraries ( KLU PRIVATE SuiteSparse::SuiteSparseConfig ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( klu_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( klu_static PUBLIC suitesparseconfig ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( klu PRIVATE m ) + target_link_libraries ( KLU PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC m ) + target_link_libraries ( KLU_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( klu PRIVATE amd ) -target_include_directories ( klu PUBLIC - "$" ) +# AMD: +target_link_libraries ( KLU PRIVATE SuiteSparse::AMD ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( klu_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( klu_static PUBLIC amd ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::AMD ) endif ( ) endif ( ) -# colamd: -target_link_libraries ( klu PRIVATE colamd ) -target_include_directories ( klu PUBLIC - "$" ) +# COLAMD: +target_link_libraries ( KLU PRIVATE SuiteSparse::COLAMD ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET colamd_static ) - target_link_libraries ( klu_static PUBLIC colamd_static ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::COLAMD_static ) else ( ) - target_link_libraries ( klu_static PUBLIC colamd ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::COLAMD ) endif ( ) endif ( ) -# btf: -target_link_libraries ( klu PRIVATE btf ) -target_include_directories ( klu PUBLIC - "$" ) +# BTF: +target_link_libraries ( KLU PRIVATE SuiteSparse::BTF ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET btf_static ) - target_link_libraries ( klu_static PUBLIC btf_static ) + if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::BTF_static ) else ( ) - target_link_libraries ( klu_static PUBLIC btf ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::BTF ) endif ( ) endif ( ) if ( NOT NCHOLMOD ) - # cholmod: + # CHOLMOD: # link with CHOLMOD and its dependencies, both required and optional - target_link_libraries ( klu PRIVATE - cholmod cholmod_cuda ) - target_link_libraries ( klu_cholmod PRIVATE - cholmod cholmod_cuda ) + target_link_libraries ( KLU PRIVATE + SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA ) + target_link_libraries ( KLU_CHOLMOD PRIVATE + SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA ) if ( NOT NSTATIC ) - if ( TARGET cholmod_static ) - target_link_libraries ( klu_static PUBLIC cholmod_static ) - target_link_libraries ( klu_cholmod_static PUBLIC cholmod_static ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD_static ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD_static ) else ( ) - target_link_libraries ( klu_static PUBLIC cholmod ) - target_link_libraries ( klu_cholmod_static PUBLIC cholmod ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD ) endif ( ) - if ( TARGET cholmod_cuda_static ) - target_link_libraries ( klu_static PUBLIC cholmod_cuda_static ) - target_link_libraries ( klu_cholmod_static PUBLIC cholmod_cuda_static ) + if ( TARGET SuiteSparse::CHOLMOD_CUDA_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD_CUDA_static ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD_CUDA_static ) else ( ) - target_link_libraries ( klu_static PUBLIC cholmod_cuda ) - target_link_libraries ( klu_cholmod_static PUBLIC cholmod_cuda ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD_CUDA ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD_CUDA ) endif ( ) endif ( ) # klu: - target_link_libraries ( klu_cholmod PRIVATE klu btf ) + target_link_libraries ( KLU_CHOLMOD PRIVATE KLU SuiteSparse::BTF ) if ( NOT NSTATIC ) - if ( TARGET btf_static ) - target_link_libraries ( klu_cholmod_static PUBLIC btf_static ) + if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::BTF_static ) else ( ) - target_link_libraries ( klu_cholmod_static PUBLIC btf ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::BTF ) endif ( ) endif ( ) @@ -317,7 +319,7 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS klu +install ( TARGETS KLU EXPORT KLUTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} @@ -325,17 +327,19 @@ install ( TARGETS klu PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS klu_static + install ( TARGETS KLU_static EXPORT KLUTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT KLUTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/KLUTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT KLUTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU ) configure_package_config_file ( @@ -353,24 +357,26 @@ install ( FILES DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU ) if ( NOT NCHOLMOD ) - install ( TARGETS klu_cholmod + install ( TARGETS KLU_CHOLMOD EXPORT KLU_CHOLMODTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS klu_cholmod_static + install ( TARGETS KLU_CHOLMOD_static EXPORT KLU_CHOLMODTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT KLU_CHOLMODTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT KLU_CHOLMODTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU_CHOLMOD ) configure_package_config_file ( @@ -413,10 +419,10 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( klu_simple PUBLIC klu ) + target_link_libraries ( klu_simple PUBLIC KLU ) if ( NOT NCHOLMOD ) - target_link_libraries ( kludemo PUBLIC klu_cholmod klu cholmod ) - target_link_libraries ( kluldemo PUBLIC klu_cholmod klu cholmod ) + target_link_libraries ( kludemo PUBLIC KLU_CHOLMOD KLU SuiteSparse::CHOLMOD ) + target_link_libraries ( kluldemo PUBLIC KLU_CHOLMOD KLU SuiteSparse::CHOLMOD ) if ( NOT WIN32 ) target_link_libraries ( kludemo PUBLIC m ) target_link_libraries ( kluldemo PUBLIC m ) diff --git a/KLU/Config/KLUConfig.cmake.in b/KLU/Config/KLUConfig.cmake.in index aa96292fa..a1049ed13 100644 --- a/KLU/Config/KLUConfig.cmake.in +++ b/KLU/Config/KLUConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the KLU include file and compiled library. # The following targets are defined: -# klu - for the shared library (if available) -# klu_static - for the static library (if available) +# SuiteSparse::KLU - for the shared library (if available) +# SuiteSparse::KLU_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/KLUTargets.cmake ) # The following is only for backward compatibility with FindKLU. -set ( _target_shared klu ) -set ( _target_static klu_static ) +set ( _target_shared SuiteSparse::KLU ) +set ( _target_static SuiteSparse::KLU_static ) set ( _var_prefix "KLU" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/KLU/Config/KLU_CHOLMODConfig.cmake.in b/KLU/Config/KLU_CHOLMODConfig.cmake.in index 205788120..73a849d4a 100644 --- a/KLU/Config/KLU_CHOLMODConfig.cmake.in +++ b/KLU/Config/KLU_CHOLMODConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the KLU include file and compiled library. # The following targets are defined: -# klu_cholmod - for the shared library (if available) -# klu_cholmod_static - for the static library (if available) +# SuiteSparse::KLU_CHOLMOD - for the shared library (if available) +# SuiteSparse::KLU_CHOLMOD_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/KLU_CHOLMODTargets.cmake ) # The following is only for backward compatibility with FindKLU_CHOLMOD. -set ( _target_shared klu_cholmod ) -set ( _target_static klu_cholmod ) +set ( _target_shared SuiteSparse::KLU_CHOLMOD ) +set ( _target_static SuiteSparse::KLU_CHOLMOD_static ) set ( _var_prefix "KLU_CHOLMOD" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/LDL/CMakeLists.txt b/LDL/CMakeLists.txt index e0f251237..d6d7a7ede 100644 --- a/LDL/CMakeLists.txt +++ b/LDL/CMakeLists.txt @@ -44,12 +44,12 @@ project ( ldl find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) @@ -76,17 +76,18 @@ include_directories ( Source Include ) file ( GLOB LDL_SOURCES "Source/*.c" ) -add_library ( ldl SHARED ${LDL_SOURCES} ) +add_library ( LDL SHARED ${LDL_SOURCES} ) -set_target_properties ( ldl PROPERTIES +set_target_properties ( LDL PROPERTIES VERSION ${LDL_VERSION_MAJOR}.${LDL_VERSION_MINOR}.${LDL_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME ldl SOVERSION ${LDL_VERSION_MAJOR} PUBLIC_HEADER "Include/ldl.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( ldl +target_include_directories ( LDL INTERFACE "$" "$" ) @@ -95,9 +96,9 @@ target_include_directories ( ldl #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( ldl_static STATIC ${LDL_SOURCES} ) + add_library ( LDL_static STATIC ${LDL_SOURCES} ) - set_target_properties ( ldl_static PROPERTIES + set_target_properties ( LDL_static PROPERTIES VERSION ${LDL_VERSION_MAJOR}.${LDL_VERSION_MINOR}.${LDL_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -105,11 +106,11 @@ if ( NOT NSTATIC ) SOVERSION ${LDL_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( ldl_static PROPERTIES + set_target_properties ( LDL_static PROPERTIES OUTPUT_NAME ldl_static ) endif ( ) - target_include_directories ( ldl_static + target_include_directories ( LDL_static INTERFACE "$" "$" ) @@ -121,27 +122,27 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( ldl PRIVATE m ) + target_link_libraries ( LDL PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( ldl_static PUBLIC m ) + target_link_libraries ( LDL_static PUBLIC m ) endif ( ) endif ( ) -target_link_libraries ( ldl PRIVATE - amd suitesparseconfig ) -target_include_directories ( ldl PUBLIC - "$" ) +target_link_libraries ( LDL PRIVATE + SuiteSparse::AMD SuiteSparse::SuiteSparseConfig ) +target_include_directories ( LDL PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( ldl_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( ldl_static PUBLIC amd ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD ) endif ( ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( ldl_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( ldl_static PUBLIC suitesparseconfig ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) @@ -152,24 +153,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS ldl +install ( TARGETS LDL EXPORT LDLTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS ldl_static + install ( TARGETS LDL_static EXPORT LDLTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT LDLTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/LDLTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT LDLTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/LDL ) configure_package_config_file ( @@ -209,17 +212,17 @@ if ( DEMO ) add_executable ( ldllmain "Demo/ldllmain.c" ) # Libraries required for Demo programs - target_link_libraries ( ldlsimple PUBLIC ldl suitesparseconfig ) - target_link_libraries ( ldllsimple PUBLIC ldl ) - target_link_libraries ( ldlmain PUBLIC ldl ) - target_link_libraries ( ldllmain PUBLIC ldl ) + target_link_libraries ( ldlsimple PUBLIC LDL SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( ldllsimple PUBLIC LDL ) + target_link_libraries ( ldlmain PUBLIC LDL ) + target_link_libraries ( ldllmain PUBLIC LDL ) if ( AMD_FOUND ) message ( STATUS "AMD found for ldlamd and ldllamd" ) add_executable ( ldlamd "Demo/ldlamd.c" ) add_executable ( ldllamd "Demo/ldllamd.c" ) - target_link_libraries ( ldlamd PUBLIC ldl amd ) - target_link_libraries ( ldllamd PUBLIC ldl amd ) + target_link_libraries ( ldlamd PUBLIC LDL SuiteSparse::AMD ) + target_link_libraries ( ldllamd PUBLIC LDL SuiteSparse::AMD ) endif ( ) else ( ) diff --git a/LDL/Config/LDLConfig.cmake.in b/LDL/Config/LDLConfig.cmake.in index eb5de5e20..948a34a58 100644 --- a/LDL/Config/LDLConfig.cmake.in +++ b/LDL/Config/LDLConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the LDL include file and compiled library. # The following targets are defined: -# ldl - for the shared library (if available) -# ldl_static - for the static library (if available) +# SuiteSparse::LDL - for the shared library (if available) +# SuiteSparse::LDL_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/LDLTargets.cmake ) # The following is only for backward compatibility with FindLDL. -set ( _target_shared ldl ) -set ( _target_static ldl_static ) +set ( _target_shared SuiteSparse::LDL ) +set ( _target_static SuiteSparse::LDL_static ) set ( _var_prefix "LDL" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt index 8decd1ff3..f102ced0b 100644 --- a/Mongoose/CMakeLists.txt +++ b/Mongoose/CMakeLists.txt @@ -75,7 +75,7 @@ configure_file ( find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -177,64 +177,65 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) if ( NOT NSTATIC ) # Build the Mongoose library - add_library ( mongoose_static STATIC ${MONGOOSE_LIB_FILES} ) -# set_property ( TARGET mongoose_static PROPERTY POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( mongoose_static PROPERTIES + add_library ( Mongoose_static STATIC ${MONGOOSE_LIB_FILES} ) +# set_property ( TARGET Mongoose_static PROPERTY POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( Mongoose_static PROPERTIES OUTPUT_NAME mongoose ) if ( MSVC ) - set_target_properties ( mongoose_static PROPERTIES + set_target_properties ( Mongoose_static PROPERTIES OUTPUT_NAME mongoose_static ) endif ( ) - target_include_directories ( mongoose_static + target_include_directories ( Mongoose_static INTERFACE "$" "$" ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( mongoose_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( Mongoose_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( mongoose_static PUBLIC suitesparseconfig ) + target_link_libraries ( Mongoose_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # Build the Mongoose library for dynamic linking -add_library ( mongoose SHARED ${MONGOOSE_LIB_FILES} ) -set_property ( TARGET mongoose PROPERTY POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( mongoose PROPERTIES +add_library ( Mongoose SHARED ${MONGOOSE_LIB_FILES} ) +set_property ( TARGET Mongoose PROPERTY POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( Mongoose PROPERTIES OUTPUT_NAME mongoose WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( mongoose +target_include_directories ( Mongoose INTERFACE "$" "$" ) -target_link_libraries ( mongoose PRIVATE suitesparseconfig ) -target_include_directories ( mongoose PUBLIC "$" ) +target_link_libraries ( Mongoose PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( Mongoose PUBLIC + "$" ) # if(CMAKE_MAJOR_VERSION GREATER 2) -# set_target_properties(mongoose PROPERTIES VERSION ${PROJECT_VERSION}) -# set_target_properties(mongoose PROPERTIES SOVERSION ${Mongoose_VERSION_MAJOR}) +# set_target_properties(Mongoose PROPERTIES VERSION ${PROJECT_VERSION}) +# set_target_properties(Mongoose PROPERTIES SOVERSION ${Mongoose_VERSION_MAJOR}) # else() - set_target_properties ( mongoose PROPERTIES + set_target_properties ( Mongoose PROPERTIES VERSION ${Mongoose_VERSION_MAJOR}.${Mongoose_VERSION_MINOR}.${Mongoose_VERSION_PATCH} SOVERSION ${Mongoose_VERSION_MAJOR} ) # endif() -set_target_properties ( mongoose PROPERTIES PUBLIC_HEADER Include/Mongoose.hpp ) -target_include_directories ( mongoose PRIVATE . ) +set_target_properties ( Mongoose PROPERTIES PUBLIC_HEADER Include/Mongoose.hpp ) +target_include_directories ( Mongoose PRIVATE . ) #------------------------------------------------------------------------------- # Build the Mongoose debug/test library -add_library ( mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) -set_target_properties ( mongoose_static_dbg PROPERTIES +add_library ( Mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) +set_target_properties ( Mongoose_static_dbg PROPERTIES OUTPUT_NAME mongoose_dbg ) -if ( TARGET suitesparseconfig_static ) - target_link_libraries ( mongoose_static_dbg suitesparseconfig_static ) +if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( mongoose_static_dbg suitesparseconfig ) + target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig ) endif ( ) # Build the Mongoose executable @@ -242,9 +243,9 @@ add_executable ( mongoose_exe ${EXE_FILES} ) set_target_properties ( mongoose_exe PROPERTIES OUTPUT_NAME mongoose ) if ( NSTATIC ) - target_link_libraries ( mongoose_exe mongoose ) + target_link_libraries ( mongoose_exe Mongoose ) else ( ) - target_link_libraries ( mongoose_exe mongoose_static ) + target_link_libraries ( mongoose_exe Mongoose_static ) endif ( ) # Build the Demo executable @@ -252,9 +253,9 @@ add_executable ( demo_exe ${DEMO_FILES} ) set_target_properties ( demo_exe PROPERTIES OUTPUT_NAME demo ) if ( NSTATIC ) - target_link_libraries ( demo_exe mongoose ) + target_link_libraries ( demo_exe Mongoose ) else ( ) - target_link_libraries ( demo_exe mongoose_static ) + target_link_libraries ( demo_exe Mongoose_static ) endif ( ) # Coverage and Unit Testing Setup @@ -265,7 +266,7 @@ set(TESTING_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests) add_executable(mongoose_test_io Tests/Mongoose_Test_IO.cpp Tests/Mongoose_Test_IO_exe.cpp) -target_link_libraries ( mongoose_test_io mongoose_static_dbg ) +target_link_libraries ( mongoose_test_io Mongoose_static_dbg ) set_target_properties(mongoose_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(IO_Test ./runTests -min 1 -max 15 -t io -k) @@ -274,7 +275,7 @@ add_test(IO_Test ./runTests -min 1 -max 15 -t io -k) add_executable(mongoose_test_edgesep Tests/Mongoose_Test_EdgeSeparator.cpp Tests/Mongoose_Test_EdgeSeparator_exe.cpp) -target_link_libraries ( mongoose_test_edgesep mongoose_static_dbg ) +target_link_libraries ( mongoose_test_edgesep Mongoose_static_dbg ) set_target_properties(mongoose_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Edge_Separator_Test ./runTests -min 1 -max 15 -t edgesep) @@ -286,7 +287,7 @@ add_test(Target_Split_Test ./runTests -min 1 -max 15 -t edgesep -s 0.3) add_executable(mongoose_test_memory Tests/Mongoose_Test_Memory.cpp Tests/Mongoose_Test_Memory_exe.cpp) -target_link_libraries ( mongoose_test_memory mongoose_static_dbg ) +target_link_libraries ( mongoose_test_memory Mongoose_static_dbg ) set_target_properties(mongoose_test_memory PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Memory_Test ./runTests -min 1 -max 15 -t memory) @@ -296,9 +297,9 @@ add_executable(mongoose_test_performance Tests/Mongoose_Test_Performance.cpp Tests/Mongoose_Test_Performance_exe.cpp) if ( NSTATIC ) - target_link_libraries ( mongoose_test_performance mongoose ) + target_link_libraries ( mongoose_test_performance Mongoose ) else ( ) - target_link_libraries ( mongoose_test_performance mongoose_static ) + target_link_libraries ( mongoose_test_performance Mongoose_static ) endif ( ) set_target_properties(mongoose_test_performance PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Performance_Test ./runTests -min 1 -max 15 -t performance -p) @@ -309,28 +310,28 @@ add_executable(mongoose_test_reference Tests/Mongoose_Test_Reference.cpp Tests/Mongoose_Test_Reference_exe.cpp) if ( NSTATIC ) - target_link_libraries ( mongoose_test_reference mongoose ) + target_link_libraries ( mongoose_test_reference Mongoose ) else ( ) - target_link_libraries ( mongoose_test_reference mongoose_static ) + target_link_libraries ( mongoose_test_reference Mongoose_static ) endif ( ) set_target_properties(mongoose_test_reference PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) # Unit Tests add_executable(mongoose_unit_test_io Tests/Mongoose_UnitTest_IO_exe.cpp) -target_link_libraries ( mongoose_unit_test_io mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_io Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_IO ./tests/mongoose_unit_test_io) add_executable(mongoose_unit_test_graph Tests/Mongoose_UnitTest_Graph_exe.cpp) -target_link_libraries ( mongoose_unit_test_graph mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_graph Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_graph PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_Graph ./tests/mongoose_unit_test_graph) add_executable(mongoose_unit_test_edgesep Tests/Mongoose_UnitTest_EdgeSep_exe.cpp) -target_link_libraries ( mongoose_unit_test_edgesep mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_edgesep Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_EdgeSep ./tests/mongoose_unit_test_edgesep) @@ -385,8 +386,8 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") # using Visual Studio C++ endif () -set_target_properties ( mongoose_static_dbg PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" ) -set_target_properties ( mongoose_static_dbg PROPERTIES LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) +set_target_properties ( Mongoose_static_dbg PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" ) +set_target_properties ( Mongoose_static_dbg PROPERTIES LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) # Add debug compile/linker flags set_target_properties(mongoose_test_io PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") @@ -408,16 +409,16 @@ set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1) # Necessary for gcov - prevents file.c file(COPY Tests/runTests DESTINATION ${CMAKE_BINARY_DIR}) # if ( NOT NSTATIC ) -# add_custom_command ( TARGET mongoose_static +# add_custom_command ( TARGET Mongoose_static # POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib +# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib # COMMENT "Copying libmongoose (static) to root Lib directory" # ) # endif ( ) -# add_custom_command ( TARGET mongoose +# add_custom_command ( TARGET Mongoose # POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib +# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib # COMMENT "Copying libmongoose (dynamic) to root Lib directory" # ) @@ -449,14 +450,14 @@ add_custom_target(userguide include ( CMakePackageConfigHelpers ) -install ( TARGETS mongoose +install ( TARGETS Mongoose EXPORT MongooseTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS mongoose_static + install ( TARGETS Mongoose_static EXPORT MongooseTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) @@ -465,10 +466,12 @@ install ( TARGETS mongoose_exe # create (temporary) export target file during build export ( EXPORT MongooseTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/MongooseTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT MongooseTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/Mongoose ) configure_package_config_file ( diff --git a/Mongoose/Config/MongooseConfig.cmake.in b/Mongoose/Config/MongooseConfig.cmake.in index bcecd43a7..84089876e 100644 --- a/Mongoose/Config/MongooseConfig.cmake.in +++ b/Mongoose/Config/MongooseConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the Mongoose include file and compiled library. # The following targets are defined: -# mongoose - for the shared library (if available) -# mongoose_static - for the static library (if available) +# SuiteSparse::Mongoose - for the shared library (if available) +# SuiteSparse::Mongoose_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/MongooseTargets.cmake ) # The following is only for backward compatibility with FindMongoose. -set ( _target_shared mongoose ) -set ( _target_static mongoose_static ) +set ( _target_shared SuiteSparse::Mongoose ) +set ( _target_static SuiteSparse::Mongoose_static ) set ( _var_prefix "MONGOOSE" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/RBio/CMakeLists.txt b/RBio/CMakeLists.txt index 64489eeec..8df57316e 100644 --- a/RBio/CMakeLists.txt +++ b/RBio/CMakeLists.txt @@ -44,7 +44,7 @@ project ( rbio find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -68,17 +68,18 @@ include_directories ( Source Include ) file ( GLOB RBIO_SOURCES "Source/*.c" ) -add_library ( rbio SHARED ${RBIO_SOURCES} ) +add_library ( RBio SHARED ${RBIO_SOURCES} ) -set_target_properties ( rbio PROPERTIES +set_target_properties ( RBio PROPERTIES VERSION ${RBIO_VERSION_MAJOR}.${RBIO_VERSION_MINOR}.${RBIO_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME rbio SOVERSION ${RBIO_VERSION_MAJOR} PUBLIC_HEADER "Include/RBio.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( rbio +target_include_directories ( RBio INTERFACE "$" "$" ) @@ -87,9 +88,9 @@ target_include_directories ( rbio #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( rbio_static STATIC ${RBIO_SOURCES} ) + add_library ( RBio_static STATIC ${RBIO_SOURCES} ) - set_target_properties ( rbio_static PROPERTIES + set_target_properties ( RBio_static PROPERTIES VERSION ${RBIO_VERSION_MAJOR}.${RBIO_VERSION_MINOR}.${RBIO_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -97,11 +98,11 @@ if ( NOT NSTATIC ) SOVERSION ${RBIO_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( rbio_static PROPERTIES + set_target_properties ( RBio_static PROPERTIES OUTPUT_NAME rbio_static ) endif ( ) - target_include_directories ( rbio_static + target_include_directories ( RBio_static INTERFACE "$" "$" ) @@ -111,22 +112,23 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( rbio PRIVATE suitesparseconfig ) -target_include_directories ( rbio PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( RBio PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( RBio PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( rbio_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( RBio_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( rbio_static PUBLIC suitesparseconfig ) + target_link_libraries ( RBio_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( rbio PRIVATE m ) + target_link_libraries ( RBio PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( rbio_static PUBLIC m ) + target_link_libraries ( RBio_static PUBLIC m ) endif ( ) endif ( ) @@ -136,24 +138,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS rbio +install ( TARGETS RBio EXPORT RBioTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS rbio_static + install ( TARGETS RBio_static EXPORT RBioTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT RBioTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/RBioTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT RBioTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/RBio ) configure_package_config_file ( @@ -190,7 +194,7 @@ if ( DEMO ) add_executable ( RBdemo "Demo/RBdemo.c" ) # Libraries required for Demo programs - target_link_libraries ( RBdemo PUBLIC rbio suitesparseconfig ) + target_link_libraries ( RBdemo PUBLIC RBio SuiteSparse::SuiteSparseConfig ) else ( ) diff --git a/RBio/Config/RBioConfig.cmake.in b/RBio/Config/RBioConfig.cmake.in index 2703bf392..2d0f259e0 100644 --- a/RBio/Config/RBioConfig.cmake.in +++ b/RBio/Config/RBioConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the RBio include file and compiled library. # The following targets are defined: -# ldl - for the shared library (if available) -# ldl_static - for the static library (if available) +# SuiteSparse::RBio - for the shared library (if available) +# SuiteSparse::RBio_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/RBioTargets.cmake ) # The following is only for backward compatibility with FindRBio. -set ( _target_shared rbio ) -set ( _target_static rbio_static ) +set ( _target_shared SuiteSparse::RBio ) +set ( _target_static SuiteSparse::RBio_static ) set ( _var_prefix "RBIO" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/SPEX/CMakeLists.txt b/SPEX/CMakeLists.txt index 4d1384e43..432feb014 100644 --- a/SPEX/CMakeLists.txt +++ b/SPEX/CMakeLists.txt @@ -46,19 +46,19 @@ project ( spex find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET colamd ) +if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) find_package ( GMP 6.1.2 REQUIRED ) # from SPEX/cmake_modules @@ -89,17 +89,18 @@ include_directories ( SPEX_Left_LU/Source SPEX_Util/Source Include file ( GLOB SPEX_SOURCES "SPEX*/Source/*.c" ) -add_library ( spex SHARED ${SPEX_SOURCES} ) +add_library ( SPEX SHARED ${SPEX_SOURCES} ) -set_target_properties ( spex PROPERTIES +set_target_properties ( SPEX PROPERTIES VERSION ${SPEX_VERSION_MAJOR}.${SPEX_VERSION_MINOR}.${SPEX_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME spex SOVERSION ${SPEX_VERSION_MAJOR} PUBLIC_HEADER "Include/SPEX.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( spex +target_include_directories ( SPEX INTERFACE "$" "$" ) @@ -108,9 +109,9 @@ target_include_directories ( spex #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( spex_static STATIC ${SPEX_SOURCES} ) + add_library ( SPEX_static STATIC ${SPEX_SOURCES} ) - set_target_properties ( spex_static PROPERTIES + set_target_properties ( SPEX_static PROPERTIES VERSION ${SPEX_VERSION_MAJOR}.${SPEX_VERSION_MINOR}.${SPEX_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -118,11 +119,11 @@ if ( NOT NSTATIC ) SOVERSION ${SPEX_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spex_static PROPERTIES + set_target_properties ( SPEX_static PROPERTIES OUTPUT_NAME spex_static ) endif ( ) - target_include_directories ( spex_static + target_include_directories ( SPEX_static INTERFACE "$" "$" ) @@ -132,55 +133,56 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( spex PRIVATE suitesparseconfig ) -target_include_directories ( spex PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( SPEX PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( SPEX PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( spex_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( spex_static PUBLIC suitesparseconfig ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) # AMD: -target_link_libraries ( spex PRIVATE amd ) +target_link_libraries ( SPEX PRIVATE SuiteSparse::AMD ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( spex_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( spex_static PUBLIC amd ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::AMD ) endif ( ) endif ( ) # COLAMD: -target_link_libraries ( spex PRIVATE colamd ) +target_link_libraries ( SPEX PRIVATE SuiteSparse::COLAMD ) if ( NOT NSTATIC ) - if ( TARGET colamd_static ) - target_link_libraries ( spex_static PUBLIC colamd_static ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::COLAMD_static ) else ( ) - target_link_libraries ( spex_static PUBLIC colamd ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::COLAMD ) endif ( ) endif ( ) # MPFR: -target_link_libraries ( spex PRIVATE ${MPFR_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE ${MPFR_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${MPFR_STATIC} ) + target_link_libraries ( SPEX_static PUBLIC ${MPFR_STATIC} ) endif ( ) # GMP: # must occur after MPFR -target_link_libraries ( spex PRIVATE ${GMP_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE ${GMP_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${GMP_STATIC} ) + target_link_libraries ( SPEX_static PUBLIC ${GMP_STATIC} ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( spex PRIVATE m ) + target_link_libraries ( SPEX PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC m ) + target_link_libraries ( SPEX_static PUBLIC m ) endif ( ) endif ( ) @@ -190,24 +192,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS spex +install ( TARGETS SPEX EXPORT SPEXTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS spex_static + install ( TARGETS SPEX_static EXPORT SPEXTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT SPEXTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/SPEXTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT SPEXTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPEX ) configure_package_config_file ( @@ -248,9 +252,9 @@ if ( DEMO ) "SPEX_Left_LU/Demo/demos.c" ) # Libraries required for Demo programs - target_link_libraries ( spexlu_demo PUBLIC spex ) - target_link_libraries ( example PUBLIC spex ) - target_link_libraries ( example2 PUBLIC spex ) + target_link_libraries ( spexlu_demo PUBLIC SPEX ) + target_link_libraries ( example PUBLIC SPEX ) + target_link_libraries ( example2 PUBLIC SPEX ) else ( ) diff --git a/SPEX/Config/SPEXConfig.cmake.in b/SPEX/Config/SPEXConfig.cmake.in index 07d2cd118..0b4d92267 100644 --- a/SPEX/Config/SPEXConfig.cmake.in +++ b/SPEX/Config/SPEXConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the SPEX include file and compiled library. # The following targets are defined: -# spex - for the shared library (if available) -# spex_static - for the static library (if available) +# SuiteSparse::SPEX - for the shared library (if available) +# SuiteSparse::SPEX_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/SPEXTargets.cmake ) # The following is only for backward compatibility with FindSPEX. -set ( _target_shared spex ) -set ( _target_static spex_static ) +set ( _target_shared SuiteSparse::SPEX ) +set ( _target_static SuiteSparse::SPEX_static ) set ( _var_prefix "SPEX" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index acbbdcd82..148aa2bca 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -66,25 +66,25 @@ endif ( ) find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET colamd ) +if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 REQUIRED ) endif ( ) find_package ( CHOLMOD 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) -if ( NOT TARGET cholmod ) +if ( NOT TARGET SuiteSparse::CHOLMOD ) find_package ( CHOLMOD 4.0.4 REQUIRED ) endif ( ) @@ -92,32 +92,32 @@ endif ( ) # CCOLAMD are optional, but must be found if CHOLMOD was built with them. find_package ( CAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET camd ) +if ( NOT TARGET SuiteSparse::CAMD ) find_package ( CAMD 3.0.4 ) endif ( ) find_package ( CCOLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET ccolamd ) +if ( NOT TARGET SuiteSparse::CCOLAMD ) find_package ( CCOLAMD 3.0.4 ) endif ( ) if ( SUITESPARSE_CUDA ) find_package ( SuiteSparse_GPURuntime 2.0.4 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/build NO_DEFAULT_PATH ) - if ( NOT TARGET suitesparse_gpuruntime ) + if ( NOT TARGET SuiteSparse::GPURuntime ) find_package ( SuiteSparse_GPURuntime 2.0.4 REQUIRED ) endif ( ) find_package ( GPUQREngine 2.0.4 PATHS ${CMAKE_SOURCE_DIR}/../GPUQREngine/build NO_DEFAULT_PATH ) - if ( NOT TARGET gpuqrengine ) + if ( NOT TARGET SuiteSparse::GPUQREngine ) find_package ( GPUQREngine 2.0.4 REQUIRED ) endif ( ) find_package ( CHOLMOD_CUDA 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod_cuda ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) find_package ( CHOLMOD_CUDA 4.0.4 REQUIRED ) endif ( ) endif ( ) @@ -126,9 +126,9 @@ include ( SuiteSparseBLAS ) # requires cmake 3.22 include ( SuiteSparseLAPACK ) # requires cmake 3.22 add_subdirectory ( SPQRGPU ) -set ( SPQR_CUDA spqr_cuda ${CUDA_LIBRARIES} ) +set ( SPQR_CUDA_LIBS SPQR_CUDA ${CUDA_LIBRARIES} ) if ( SUITESPARSE_CUDA ) - list ( APPEND SPQR_CUDA gpuqrengine suitesparse_gpuruntime cholmod_cuda ) + list ( APPEND SPQR_CUDA_LIBS SuiteSparse::GPUQREngine SuiteSparse::GPURuntime SuiteSparse::CHOLMOD_CUDA ) endif ( ) if ( SUITESPARSE_CUDA ) @@ -160,18 +160,19 @@ include_directories ( Source Include ) file ( GLOB SPQR_SOURCES "Source/spqr_*.cpp" "Source/SuiteSparseQR*.cpp" ) -add_library ( spqr SHARED ${SPQR_SOURCES} ) +add_library ( SPQR SHARED ${SPQR_SOURCES} ) -set_target_properties ( spqr PROPERTIES +set_target_properties ( SPQR PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME spqr SOVERSION ${SPQR_VERSION_MAJOR} WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( spqr +target_include_directories ( SPQR INTERFACE "$" "$" ) @@ -180,9 +181,9 @@ target_include_directories ( spqr #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( spqr_static STATIC ${SPQR_SOURCES} ) + add_library ( SPQR_static STATIC ${SPQR_SOURCES} ) - set_target_properties ( spqr_static PROPERTIES + set_target_properties ( SPQR_static PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON @@ -192,11 +193,11 @@ if ( NOT NSTATIC ) SOVERSION ${SPQR_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spqr_static PROPERTIES + set_target_properties ( SPQR_static PROPERTIES OUTPUT_NAME spqr_static ) endif ( ) - target_include_directories ( spqr_static + target_include_directories ( SPQR_static INTERFACE "$" "$" ) @@ -206,13 +207,13 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( spqr PRIVATE suitesparseconfig ) +# SuiteSparseConfig: +target_link_libraries ( SPQR PRIVATE SuiteSparse::SuiteSparseConfig ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( spqr_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( spqr_static PUBLIC suitesparseconfig ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) @@ -221,9 +222,9 @@ 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 ( spqr PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SPQR PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) @@ -231,29 +232,29 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( spqr PRIVATE m ) + target_link_libraries ( SPQR PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC m ) + target_link_libraries ( SPQR_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( spqr PRIVATE amd ) +# AMD: +target_link_libraries ( SPQR PRIVATE SuiteSparse::AMD ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( spqr_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( spqr_static PUBLIC amd ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::AMD ) endif ( ) endif ( ) -# colamd: -target_link_libraries ( spqr PRIVATE colamd ) +# COLAMD: +target_link_libraries ( SPQR PRIVATE SuiteSparse::COLAMD ) if ( NOT NSTATIC ) - if ( TARGET colamd_static ) - target_link_libraries ( spqr_static PUBLIC colamd_static ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::COLAMD_static ) else ( ) - target_link_libraries ( spqr_static PUBLIC colamd ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::COLAMD ) endif ( ) endif ( ) @@ -261,9 +262,9 @@ endif ( ) message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") -target_link_libraries ( spqr PRIVATE ${BLAS_LIBRARIES} ) +target_link_libraries ( SPQR PRIVATE ${BLAS_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${BLAS_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC ${BLAS_LIBRARIES} ) endif ( ) include_directories ( ${BLAS_INCLUDE_DIRS} ) @@ -271,31 +272,31 @@ include_directories ( ${BLAS_INCLUDE_DIRS} ) message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES} ") message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS} ") message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS} ") -target_link_libraries ( spqr PRIVATE ${LAPACK_LIBRARIES} ) +target_link_libraries ( SPQR PRIVATE ${LAPACK_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${LAPACK_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC ${LAPACK_LIBRARIES} ) endif ( ) include_directories ( ${LAPACK_INCLUDE_DIR} ) -# cholmod: +# CHOLMOD: # link with CHOLMOD and its dependencies, both required and optional -target_link_libraries ( spqr PRIVATE - cholmod ${CHOLMOD_CUDA_LIBRARIES} ) +target_link_libraries ( SPQR PRIVATE + SuiteSparse::CHOLMOD ${CHOLMOD_CUDA_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC + target_link_libraries ( SPQR_static PUBLIC ${CHOLMOD_CUDA_STATIC} ) - if ( TARGET cholmod_static ) - target_link_libraries ( spqr_static PUBLIC cholmod_static ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_static ) else ( ) - target_link_libraries ( spqr_static PUBLIC cholmod ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD ) endif ( ) endif ( ) # CUDA -message ( STATUS "SPQR cuda: ${SPQR_CUDA} " ) -target_link_libraries ( spqr PRIVATE ${SPQR_CUDA} ${CUDA_LIBRARIES} ) +message ( STATUS "SPQR cuda: ${SPQR_CUDA_LIBS} " ) +target_link_libraries ( SPQR PRIVATE ${SPQR_CUDA_LIBS} ${CUDA_LIBRARIES} ) if ( NOT NSTATIC ) -target_link_libraries ( spqr_static PUBLIC ${SPQR_CUDA} ${CUDA_LIBRARIES} ) +target_link_libraries ( SPQR_static PUBLIC ${SPQR_CUDA_LIBS} ${CUDA_LIBRARIES} ) endif ( ) #------------------------------------------------------------------------------- @@ -304,13 +305,13 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS spqr +install ( TARGETS SPQR EXPORT SPQRTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) if ( NOT NSTATIC ) - install ( TARGETS spqr_static + install ( TARGETS SPQR_static EXPORT SPQRTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) @@ -321,10 +322,12 @@ install ( FILES "Include/SuiteSparseQR_C.h" # create (temporary) export target file during build export ( EXPORT SPQRTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/SPQRTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT SPQRTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR ) configure_package_config_file ( @@ -375,22 +378,22 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( qrsimple PUBLIC spqr ${SPQR_CUDA} cholmod ) - target_link_libraries ( qrsimplec PUBLIC spqr ${SPQR_CUDA} cholmod ) - target_link_libraries ( qrdemo PUBLIC spqr ${SPQR_CUDA} cholmod ) - target_link_libraries ( qrdemoc PUBLIC spqr ${SPQR_CUDA} cholmod ) + target_link_libraries ( qrsimple PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) + target_link_libraries ( qrsimplec PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemo PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemoc PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) - target_link_libraries ( qrsimplec_int32 PUBLIC spqr ${SPQR_CUDA} cholmod ) - target_link_libraries ( qrdemoc_int32 PUBLIC spqr ${SPQR_CUDA} cholmod ) - target_link_libraries ( qrdemo_int32 PUBLIC spqr ${SPQR_CUDA} cholmod ) + target_link_libraries ( qrsimplec_int32 PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemoc_int32 PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemo_int32 PUBLIC SPQR ${SPQR_CUDA_LIBS} SuiteSparse::CHOLMOD ) if ( SUITESPARSE_CUDA ) - target_link_libraries ( qrdemo_gpu PUBLIC spqr ${SPQR_CUDA} - cholmod suitesparseconfig ) - target_link_libraries ( qrdemo_gpu2 PUBLIC spqr ${SPQR_CUDA} - cholmod suitesparseconfig ) - target_link_libraries ( qrdemo_gpu3 PUBLIC spqr ${SPQR_CUDA} - cholmod suitesparseconfig ) + target_link_libraries ( qrdemo_gpu PUBLIC SPQR ${SPQR_CUDA_LIBS} + SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR ${SPQR_CUDA_LIBS} + SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR ${SPQR_CUDA_LIBS} + SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) endif ( ) else ( ) diff --git a/SPQR/Config/SPQRConfig.cmake.in b/SPQR/Config/SPQRConfig.cmake.in index 3430ba2b0..a89d3fe1f 100644 --- a/SPQR/Config/SPQRConfig.cmake.in +++ b/SPQR/Config/SPQRConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the SPQR include file and compiled library. # The following targets are defined: -# spqr - for the shared library (if available) -# spqr_static - for the static library (if available) +# SuiteSparse::SPQR - for the shared library (if available) +# SuiteSparse::SPQR_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -46,8 +46,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/SPQRTargets.cmake ) # The following is only for backward compatibility with FindSPQR. -set ( _target_shared spqr ) -set ( _target_static spqr_static ) +set ( _target_shared SuiteSparse::SPQR ) +set ( _target_static SuiteSparse::SPQR_static ) set ( _var_prefix "SPQR" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/SPQR/Config/SPQR_CUDAConfig.cmake.in b/SPQR/Config/SPQR_CUDAConfig.cmake.in index 3829befcc..35a46df88 100644 --- a/SPQR/Config/SPQR_CUDAConfig.cmake.in +++ b/SPQR/Config/SPQR_CUDAConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the SPQR_CUDA include file and compiled library. # The following targets are defined: -# spqr_cuda - for the shared library (if available) -# spqr_cuda_static - for the static library (if available) +# SuiteSparse::SPQR_CUDA - for the shared library (if available) +# SuiteSparse::SPQR_CUDA_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -38,8 +38,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/SPQR_CUDATargets.cmake ) # The following is only for backward compatibility with FindSPQR_CUDA. -set ( _target_shared spqr_cuda ) -set ( _target_static spqr_cuda_static ) +set ( _target_shared SuiteSparse::SPQR_CUDA ) +set ( _target_static SuiteSparse::SPQR_CUDA_static ) set ( _var_prefix "SPQR_CUDA" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/SPQR/SPQRGPU/CMakeLists.txt b/SPQR/SPQRGPU/CMakeLists.txt index 18c4e7f53..abd8d831b 100644 --- a/SPQR/SPQRGPU/CMakeLists.txt +++ b/SPQR/SPQRGPU/CMakeLists.txt @@ -36,20 +36,21 @@ endif ( ) file ( GLOB SPQR_CUDA_SOURCES "spqrgpu_*.cpp" ) -add_library ( spqr_cuda SHARED ${SPQR_CUDA_SOURCES} ) +add_library ( SPQR_CUDA SHARED ${SPQR_CUDA_SOURCES} ) -set_target_properties ( spqr_cuda PROPERTIES +set_target_properties ( SPQR_CUDA PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 C_STANDARD_REQUIRED ON C_STANDARD 11 + OUTPUT_NAME spqr_cuda SOVERSION ${SPQR_VERSION_MAJOR} ) if ( NOT NSTATIC ) - add_library ( spqr_cuda_static STATIC ${SPQR_CUDA_SOURCES} ) + add_library ( SPQR_CUDA_static STATIC ${SPQR_CUDA_SOURCES} ) - set_target_properties ( spqr_cuda_static PROPERTIES + set_target_properties ( SPQR_CUDA_static PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 @@ -59,8 +60,8 @@ if ( NOT NSTATIC ) SOVERSION ${SPQR_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spqr_cuda_static PROPERTIES - OUTPUT_NAME spqr_cuda_static ) + set_target_properties ( SPQR_CUDA_static PROPERTIES + OUTPUT_NAME SPQR_CUDA_static ) endif ( ) endif ( ) @@ -68,49 +69,49 @@ set ( SPQR_CUDA_INCLUDES ../Include ) include_directories ( ${SPQR_CUDA_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) -if ( TARGET gpuqrengine ) - target_include_directories ( spqr_cuda PRIVATE - $ ) - target_include_directories ( spqr_cuda_static PRIVATE - $ ) +if ( TARGET SuiteSparse::GPUQREngine ) + target_include_directories ( SPQR_CUDA PRIVATE + $ ) + target_include_directories ( SPQR_CUDA_static PRIVATE + $ ) endif ( ) -if ( TARGET suitesparse_gpuruntime ) - target_include_directories ( spqr_cuda PRIVATE - $ ) - target_include_directories ( spqr_cuda_static PRIVATE - $ ) +if ( TARGET SuiteSparse::GPURuntime ) + target_include_directories ( SPQR_CUDA PRIVATE + $ ) + target_include_directories ( SPQR_CUDA_static PRIVATE + $ ) endif ( ) -target_include_directories ( spqr_cuda PRIVATE +target_include_directories ( SPQR_CUDA PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${SPQR_CUDA_INCLUDES} - $ ) -set_target_properties ( spqr_cuda PROPERTIES POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( spqr_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + $ ) +set_target_properties ( SPQR_CUDA PROPERTIES POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( SPQR_CUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) if ( NOT NSTATIC ) -target_include_directories ( spqr_cuda_static PRIVATE +target_include_directories ( SPQR_CUDA_static PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${SPQR_CUDA_INCLUDES} - $ ) -set_target_properties ( spqr_cuda_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) -set_target_properties ( spqr_cuda_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + $ ) +set_target_properties ( SPQR_CUDA_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) +set_target_properties ( SPQR_CUDA_static PROPERTIES POSITION_INDEPENDENT_CODE on ) -if ( TARGET cholmod_static ) - target_link_libraries ( spqr_cuda_static PUBLIC cholmod_static ) +if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( SPQR_CUDA_static PUBLIC SuiteSparse::CHOLMOD_static ) else ( ) - target_link_libraries ( spqr_cuda_static PUBLIC cholmod ) + target_link_libraries ( SPQR_CUDA_static PUBLIC SuiteSparse::CHOLMOD ) endif ( ) endif ( ) -target_link_libraries ( spqr_cuda PRIVATE cholmod ) +target_link_libraries ( SPQR_CUDA PRIVATE SuiteSparse::CHOLMOD ) if ( SUITESPARSE_CUDA ) - target_link_libraries ( spqr_cuda PRIVATE CUDA::nvrtc CUDA::cudart_static + target_link_libraries ( SPQR_CUDA PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_cuda_static PUBLIC CUDA::nvrtc CUDA::cudart_static + target_link_libraries ( SPQR_CUDA_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) endif ( ) @@ -121,24 +122,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS spqr_cuda +install ( TARGETS SPQR_CUDA EXPORT SPQR_CUDATargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) if ( NOT NSTATIC ) -install ( TARGETS spqr_cuda_static +install ( TARGETS SPQR_CUDA_static EXPORT SPQR_CUDATargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT SPQR_CUDATargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDATargets.cmake ) # install export target, config and version files for find_package install ( EXPORT SPQR_CUDATargets + NAMESPACE SuiteSparse:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SPQR_CUDA ) configure_package_config_file ( diff --git a/SuiteSparse_GPURuntime/CMakeLists.txt b/SuiteSparse_GPURuntime/CMakeLists.txt index 5156e4b3a..136ddcc21 100644 --- a/SuiteSparse_GPURuntime/CMakeLists.txt +++ b/SuiteSparse_GPURuntime/CMakeLists.txt @@ -55,7 +55,7 @@ endif ( ) find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) @@ -86,31 +86,32 @@ include_directories ( ${SUITESPARSE_GPURUNTIME_INCLUDES} ${CUDAToolkit_INCLUDE_D # dynamic suitesparse_gpuruntime library properties #------------------------------------------------------------------------------- -add_library ( suitesparse_gpuruntime SHARED ${SUITESPARSE_GPURUNTIME_SOURCES} ) +add_library ( GPURuntime SHARED ${SUITESPARSE_GPURUNTIME_SOURCES} ) -set_target_properties ( suitesparse_gpuruntime PROPERTIES +set_target_properties ( GPURuntime PROPERTIES VERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR}.${SUITESPARSE_GPURUNTIME_VERSION_MINOR}.${SUITESPARSE_GPURUNTIME_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON + OUTPUT_NAME suitesparse_gpuruntime SOVERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR} PUBLIC_HEADER "Include/SuiteSparse_GPURuntime.hpp" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( suitesparse_gpuruntime PRIVATE +target_include_directories ( GPURuntime PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${SUITESPARSE_GPURUNTIME_INCLUDES} ) -target_include_directories ( suitesparse_gpuruntime PUBLIC - $ ) +target_include_directories ( GPURuntime PUBLIC + $ ) if ( SUITESPARSE_CUDA ) - set_target_properties ( suitesparse_gpuruntime PROPERTIES POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( suitesparse_gpuruntime PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) - target_link_libraries ( suitesparse_gpuruntime PRIVATE CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPURuntime PROPERTIES POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( GPURuntime PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + target_link_libraries ( GPURuntime PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) -target_include_directories ( suitesparse_gpuruntime +target_include_directories ( GPURuntime INTERFACE "$" "$" ) @@ -119,9 +120,9 @@ target_include_directories ( suitesparse_gpuruntime #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( suitesparse_gpuruntime_static STATIC ${SUITESPARSE_GPURUNTIME_SOURCES} ) + add_library ( GPURuntime_static STATIC ${SUITESPARSE_GPURUNTIME_SOURCES} ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES + set_target_properties ( GPURuntime_static PROPERTIES VERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR}.${SUITESPARSE_GPURUNTIME_VERSION_MINOR}.${SUITESPARSE_GPURUNTIME_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON @@ -129,25 +130,25 @@ if ( NOT NSTATIC ) SOVERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES + set_target_properties ( GPURuntime_static PROPERTIES OUTPUT_NAME suitesparse_gpuruntime_static ) endif ( ) - target_include_directories ( suitesparse_gpuruntime_static PRIVATE + target_include_directories ( GPURuntime_static PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${SUITESPARSE_GPURUNTIME_INCLUDES} ) - target_include_directories ( suitesparse_gpuruntime_static PUBLIC - $ ) + target_include_directories ( GPURuntime_static PUBLIC + $ ) if ( SUITESPARSE_CUDA ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_link_libraries ( suitesparse_gpuruntime_static PUBLIC CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPURuntime_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( GPURuntime_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + target_link_libraries ( GPURuntime_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) - target_include_directories ( suitesparse_gpuruntime_static + target_include_directories ( GPURuntime_static INTERFACE "$" "$" ) @@ -159,24 +160,26 @@ endif ( ) include ( CMakePackageConfigHelpers ) -install ( TARGETS suitesparse_gpuruntime +install ( TARGETS GPURuntime EXPORT SuiteSparse_GPURuntimeTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS suitesparse_gpuruntime_static + install ( TARGETS GPURuntime_static EXPORT SuiteSparse_GPURuntimeTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT SuiteSparse_GPURuntimeTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeTargets.cmake ) # install export target, config and version files for find_package install ( EXPORT SuiteSparse_GPURuntimeTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_GPURuntime ) configure_package_config_file ( diff --git a/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in index 96a266ddf..fa6234140 100644 --- a/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in +++ b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the SuiteSparse_GPURuntime include file and compiled library. # The following targets are defined: -# suitesparse_gpuruntime - for the shared library (if available) -# suitesparse_gpuruntime_static - for the static library (if available) +# SuiteSparse::GPURuntime - for the shared library (if available) +# SuiteSparse::GPURuntime_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_GPURuntimeTargets.cmake ) # The following is only for backward compatibility with FindSuiteSparse_GPURuntime. -set ( _target_shared suitesparse_gpuruntime ) -set ( _target_static suitesparse_gpuruntime_static ) +set ( _target_shared SuiteSparse::GPURuntime ) +set ( _target_static SuiteSparse::GPURuntime_static ) set ( _var_prefix "SUITESPARSE_GPURUNTIME" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index 3cd4604ff..1613260c4 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -45,7 +45,7 @@ endif ( ) # define the project #------------------------------------------------------------------------------- -project ( suitesparseconfig +project ( SuiteSparseConfig VERSION "${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB}" LANGUAGES C ) @@ -77,32 +77,33 @@ configure_file ( "Config/README.md.in" NEWLINE_STYLE LF ) #------------------------------------------------------------------------------- -# dynamic suitesparseconfig library properties +# dynamic SuiteSparseConfig library properties #------------------------------------------------------------------------------- file ( GLOB SUITESPARSECONFIG_SOURCES "*.c" ) -add_library ( suitesparseconfig SHARED ${SUITESPARSECONFIG_SOURCES} ) -set_target_properties ( suitesparseconfig PROPERTIES +add_library ( SuiteSparseConfig SHARED ${SUITESPARSECONFIG_SOURCES} ) +set_target_properties ( SuiteSparseConfig PROPERTIES VERSION ${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME suitesparseconfig SOVERSION ${SUITESPARSE_VERSION_MAJOR} PUBLIC_HEADER "SuiteSparse_config.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( suitesparseconfig +target_include_directories ( SuiteSparseConfig INTERFACE "$" "$" ) #------------------------------------------------------------------------------- -# static suitesparseconfig library properties +# static SuiteSparseConfig library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( suitesparseconfig_static STATIC ${SUITESPARSECONFIG_SOURCES} ) + add_library ( SuiteSparseConfig_static STATIC ${SUITESPARSECONFIG_SOURCES} ) - set_target_properties ( suitesparseconfig_static PROPERTIES + set_target_properties ( SuiteSparseConfig_static PROPERTIES VERSION ${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -110,11 +111,11 @@ if ( NOT NSTATIC ) SOVERSION ${SUITESPARSE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( suitesparseconfig_static PROPERTIES + set_target_properties ( SuiteSparseConfig_static PROPERTIES OUTPUT_NAME suitesparseconfig_static ) endif ( ) - target_include_directories ( suitesparseconfig_static + target_include_directories ( SuiteSparseConfig_static INTERFACE "$" "$" ) endif ( ) @@ -125,9 +126,9 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( suitesparseconfig PRIVATE m ) + target_link_libraries ( SuiteSparseConfig PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( suitesparseconfig_static PUBLIC m ) + target_link_libraries ( SuiteSparseConfig_static PUBLIC m ) endif ( ) endif ( ) @@ -136,9 +137,9 @@ 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 ( suitesparseconfig PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SuiteSparseConfig PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( suitesparseconfig_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SuiteSparseConfig_static PUBLIC ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) @@ -155,14 +156,14 @@ if ( BLAS_FOUND ) endif ( ) #------------------------------------------------------------------------------- -# suitesparseconfig installation location +# SuiteSparseConfig installation location #------------------------------------------------------------------------------- include ( CMakePackageConfigHelpers ) file ( GLOB SUITESPARSE_CMAKE_MODULES "cmake_modules/*" ) -install ( TARGETS suitesparseconfig +install ( TARGETS SuiteSparseConfig EXPORT SuiteSparse_configTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} @@ -173,17 +174,19 @@ install ( FILES DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS suitesparseconfig_static + install ( TARGETS SuiteSparseConfig_static EXPORT SuiteSparse_configTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) # create (temporary) export target file during build export ( EXPORT SuiteSparse_configTargets + NAMESPACE SuiteSparse:: FILE ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configTargets.cmake ) # install export target and config for find_package install ( EXPORT SuiteSparse_configTargets + NAMESPACE SuiteSparse:: DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_config ) configure_package_config_file ( diff --git a/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in index c9585f9e2..c16ffd80d 100644 --- a/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in +++ b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in @@ -11,8 +11,8 @@ # Finds the SuiteSparse_config include file and compiled library. # The following targets are defined: -# suitesparseconfig - for the shared library (if available) -# suitesparseconfig_static - for the static library (if available) +# SuiteSparseConfig - for the shared library (if available) +# SuiteSparseConfig_static - for the static library (if available) # For backward compatibility the following variables are set: @@ -39,8 +39,8 @@ include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_configTargets.cmake ) # The following is only for backward compatibility with FindSuiteSparse_config. -set ( _target_shared suitesparseconfig ) -set ( _target_static suitesparseconfig_static ) +set ( _target_shared SuiteSparse::SuiteSparseConfig ) +set ( _target_static SuiteSparse::SuiteSparseConfig_static ) set ( _var_prefix "SUITESPARSE_CONFIG" ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index 78b1adbc8..988570881 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -54,12 +54,12 @@ endif ( ) find_package ( SuiteSparse_config 7.1.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) -if ( NOT TARGET suitesparseconfig ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_package ( SuiteSparse_config 7.1.0 REQUIRED ) endif ( ) find_package ( AMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) -if ( NOT TARGET amd ) +if ( NOT TARGET SuiteSparse::AMD ) find_package ( AMD 3.0.4 REQUIRED ) endif ( ) include ( SuiteSparseBLAS ) # requires cmake 3.22 @@ -70,13 +70,13 @@ if ( NOT NCHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) find_package ( CHOLMOD 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) find_package ( CHOLMOD 4.0.4 ) endif ( ) find_package ( CHOLMOD_CUDA 4.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET cholmod_cuda ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) find_package ( CHOLMOD_CUDA 4.0.4 REQUIRED ) endif ( ) @@ -84,19 +84,19 @@ if ( NOT NCHOLMOD ) # CCOLAMD are optional, but must be found if CHOLMOD was built with them. find_package ( COLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET colamd ) + if ( NOT TARGET SuiteSparse::COLAMD ) find_package ( COLAMD 3.0.4 ) endif ( ) find_package ( CAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET camd ) + if ( NOT TARGET SuiteSparse::CAMD ) find_package ( CAMD 3.0.4 ) endif ( ) find_package ( CCOLAMD 3.0.4 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) - if ( NOT TARGET ccolamd ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) find_package ( CCOLAMD 3.0.4 ) endif ( ) @@ -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 "$" "$" ) @@ -156,9 +157,9 @@ 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 @@ -166,11 +167,11 @@ if ( NOT NSTATIC ) 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 "$" "$" ) @@ -180,14 +181,14 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( umfpack PRIVATE suitesparseconfig ) -target_include_directories ( umfpack PUBLIC "$" ) +# SuiteSparseConfig: +target_link_libraries ( UMFPACK PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( UMFPACK PUBLIC "$" ) if ( NOT NSTATIC ) - if ( TARGET suitesparseconfig_static ) - target_link_libraries ( umfpack_static PUBLIC suitesparseconfig_static ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( umfpack_static PUBLIC suitesparseconfig ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) endif ( ) @@ -196,9 +197,9 @@ 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} ) @@ -206,20 +207,21 @@ 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 amd ) -target_include_directories ( umfpack PUBLIC "$" ) +# AMD: +target_link_libraries ( UMFPACK PRIVATE SuiteSparse::AMD ) +target_include_directories ( UMFPACK PUBLIC + "$" ) if ( NOT NSTATIC ) - if ( TARGET amd_static ) - target_link_libraries ( umfpack_static PUBLIC amd_static ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD_static ) else ( ) - target_link_libraries ( umfpack_static PUBLIC amd ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD ) endif ( ) endif ( ) @@ -227,24 +229,24 @@ endif ( ) 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: +# CHOLMOD: if ( NOT NCHOLMOD ) # link with CHOLMOD and its dependencies, both required and optional - target_link_libraries ( umfpack PRIVATE - cholmod ${CHOLMOD_CUDA_LIBRARIES} ) + 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 cholmod_static ) - target_link_libraries ( umfpack_static PUBLIC cholmod_static ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD_static ) else ( ) - target_link_libraries ( umfpack_static PUBLIC cholmod ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD ) endif ( ) endif ( ) endif ( ) @@ -255,24 +257,26 @@ 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 ( ) # 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 ( @@ -329,42 +333,42 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( umfpack_simple PUBLIC umfpack 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? target_link_libraries ( umfpack_di_demo PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_dl_demo PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_zi_demo PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_zl_demo PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) endif ( ) if ( NOT NFORTRAN ) # Fortran demos - target_link_libraries ( umf4 PUBLIC umfpack 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 # rpath instead? target_link_libraries ( umf4hb PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4zhb PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4hb64 PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4zhb64 PUBLIC - colamd camd ccolamd ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) endif ( ) endif ( ) diff --git a/UMFPACK/Config/UMFPACKConfig.cmake.in b/UMFPACK/Config/UMFPACKConfig.cmake.in index 6c49671ed..0fd7f87e2 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 )