From 1332e6353f813b85660f48c9f8c7046463d133fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 6 Sep 2023 12:01:34 +0200 Subject: [PATCH] Don't generate .pc files for MSVC compatible tool chains. --- AMD/CMakeLists.txt | 44 +++++++------- BTF/CMakeLists.txt | 44 +++++++------- CAMD/CMakeLists.txt | 44 +++++++------- CCOLAMD/CMakeLists.txt | 44 +++++++------- CHOLMOD/CMakeLists.txt | 87 +++++++++++++------------- CHOLMOD/GPU/CMakeLists.txt | 47 +++++++------- COLAMD/CMakeLists.txt | 44 +++++++------- CSparse/CMakeLists.txt | 44 +++++++------- CXSparse/CMakeLists.txt | 44 +++++++------- GPUQREngine/CMakeLists.txt | 44 +++++++------- GraphBLAS/CMakeLists.txt | 87 +++++++++++++------------- KLU/CMakeLists.txt | 88 ++++++++++++++------------- LDL/CMakeLists.txt | 44 +++++++------- Mongoose/CMakeLists.txt | 44 +++++++------- RBio/CMakeLists.txt | 44 +++++++------- SPEX/CMakeLists.txt | 87 +++++++++++++------------- SPQR/CMakeLists.txt | 87 +++++++++++++------------- SPQR/SPQRGPU/CMakeLists.txt | 47 +++++++------- SuiteSparse_GPURuntime/CMakeLists.txt | 44 +++++++------- SuiteSparse_config/CMakeLists.txt | 44 +++++++------- UMFPACK/CMakeLists.txt | 87 +++++++++++++------------- 21 files changed, 617 insertions(+), 572 deletions(-) diff --git a/AMD/CMakeLists.txt b/AMD/CMakeLists.txt index 003daf026..030903c87 100644 --- a/AMD/CMakeLists.txt +++ b/AMD/CMakeLists.txt @@ -196,28 +196,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/AMD.pc.in + AMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/AMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/AMD.pc.in - AMD.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/AMD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/BTF/CMakeLists.txt b/BTF/CMakeLists.txt index 8a0dcf3a7..b55fbd400 100644 --- a/BTF/CMakeLists.txt +++ b/BTF/CMakeLists.txt @@ -179,28 +179,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/BTF.pc.in + BTF.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/BTF.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/BTF.pc.in - BTF.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/BTF.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # report status diff --git a/CAMD/CMakeLists.txt b/CAMD/CMakeLists.txt index 0adf1faca..9d24e6976 100644 --- a/CAMD/CMakeLists.txt +++ b/CAMD/CMakeLists.txt @@ -181,28 +181,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CAMD.pc.in + CAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/CAMD.pc.in - CAMD.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CAMD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/CCOLAMD/CMakeLists.txt b/CCOLAMD/CMakeLists.txt index d3ae64037..52df4a501 100644 --- a/CCOLAMD/CMakeLists.txt +++ b/CCOLAMD/CMakeLists.txt @@ -178,28 +178,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CCOLAMD.pc.in + CCOLAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/CCOLAMD.pc.in - CCOLAMD.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index f4f6575d9..a81aa3578 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -557,52 +557,53 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -# This might be something like: -# /usr/lib/libgomp.so;/usr/lib/libpthread.a;m -# convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" -set ( CHOLMOD_STATIC_LIBS_LIST ${CHOLMOD_STATIC_LIBS} ) -set ( CHOLMOD_STATIC_LIBS "" ) -foreach ( _lib ${CHOLMOD_STATIC_LIBS_LIST} ) - string ( FIND ${_lib} "." _pos REVERSE ) - if ( ${_pos} EQUAL "-1" ) - set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_lib}" ) - continue () - endif ( ) - foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) - set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) - if ( ${_lib} MATCHES ${_regex} ) - string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) - if ( NOT "${_libname}" STREQUAL "" ) - set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_libname}" ) - break () - endif ( ) +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( CHOLMOD_STATIC_LIBS_LIST ${CHOLMOD_STATIC_LIBS} ) + set ( CHOLMOD_STATIC_LIBS "" ) + foreach ( _lib ${CHOLMOD_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_lib}" ) + continue () endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) endforeach ( ) -endforeach ( ) -message ( STATUS "CHOLMOD_STATIC_LIBS: ${CHOLMOD_STATIC_LIBS}" ) - -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CHOLMOD.pc.in + CHOLMOD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/CHOLMOD.pc.in - CHOLMOD.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/CHOLMOD/GPU/CMakeLists.txt b/CHOLMOD/GPU/CMakeLists.txt index e6f5b076d..2a009b499 100644 --- a/CHOLMOD/GPU/CMakeLists.txt +++ b/CHOLMOD/GPU/CMakeLists.txt @@ -134,26 +134,31 @@ install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfigVersion.cmake DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD_CUDA ) +#------------------------------------------------------------------------------- # create pkg-config file -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + ../Config/CHOLMOD_CUDA.pc.in + CHOLMOD_CUDA.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD_CUDA.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - ../Config/CHOLMOD_CUDA.pc.in - CHOLMOD_CUDA.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD_CUDA.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) diff --git a/COLAMD/CMakeLists.txt b/COLAMD/CMakeLists.txt index b3f6c2790..6f80ee402 100644 --- a/COLAMD/CMakeLists.txt +++ b/COLAMD/CMakeLists.txt @@ -178,28 +178,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/COLAMD.pc.in + COLAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/COLAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/COLAMD.pc.in - COLAMD.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/COLAMD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/CSparse/CMakeLists.txt b/CSparse/CMakeLists.txt index 15df9e005..76eac0433 100644 --- a/CSparse/CMakeLists.txt +++ b/CSparse/CMakeLists.txt @@ -130,28 +130,30 @@ endif ( ) # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${CMAKE_INSTALL_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${CMAKE_INSTALL_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${CMAKE_INSTALL_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CSparse.pc.in + CSparse.pc + @ONLY + NEWLINE_STYLE LF ) + # install ( FILES + # ${CMAKE_CURRENT_BINARY_DIR}/CSparse.pc + # DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/CSparse.pc.in - CSparse.pc - @ONLY - NEWLINE_STYLE LF ) -# install ( FILES -# ${CMAKE_CURRENT_BINARY_DIR}/CSparse.pc -# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/CXSparse/CMakeLists.txt b/CXSparse/CMakeLists.txt index 67fc8815c..66aac8bff 100644 --- a/CXSparse/CMakeLists.txt +++ b/CXSparse/CMakeLists.txt @@ -211,28 +211,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CXSparse.pc.in + CXSparse.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CXSparse.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/CXSparse.pc.in - CXSparse.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CXSparse.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/GPUQREngine/CMakeLists.txt b/GPUQREngine/CMakeLists.txt index 48b239384..2fd138b8a 100644 --- a/GPUQREngine/CMakeLists.txt +++ b/GPUQREngine/CMakeLists.txt @@ -267,28 +267,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/GPUQREngine.pc.in + GPUQREngine.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngine.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/GPUQREngine.pc.in - GPUQREngine.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngine.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 4a0a92f11..03f24d6e9 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -508,52 +508,53 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -# This might be something like: -# /usr/lib/libgomp.so;/usr/lib/libpthread.a;m -# convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" -set ( GRAPHBLAS_STATIC_LIBS_LIST ${GRAPHBLAS_STATIC_LIBS} ) -set ( GRAPHBLAS_STATIC_LIBS "" ) -foreach ( _lib ${GRAPHBLAS_STATIC_LIBS_LIST} ) - string ( FIND ${_lib} "." _pos REVERSE ) - if ( ${_pos} EQUAL "-1" ) - set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_lib}" ) - continue () - endif ( ) - foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) - set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) - if ( ${_lib} MATCHES ${_regex} ) - string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) - if ( NOT "${_libname}" STREQUAL "" ) - set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_libname}" ) - break () - endif ( ) +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( GRAPHBLAS_STATIC_LIBS_LIST ${GRAPHBLAS_STATIC_LIBS} ) + set ( GRAPHBLAS_STATIC_LIBS "" ) + foreach ( _lib ${GRAPHBLAS_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_lib}" ) + continue () endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) endforeach ( ) -endforeach ( ) -message ( STATUS "GRAPHBLAS_STATIC_LIBS: ${GRAPHBLAS_STATIC_LIBS}" ) - -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/GraphBLAS.pc.in + GraphBLAS.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLAS.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/GraphBLAS.pc.in - GraphBLAS.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/GraphBLAS.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # configure the JITs diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index 9988ac0b1..98fdff540 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -371,28 +371,30 @@ install ( FILES # create pkg-config file for KLU #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/KLU.pc.in + KLU.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLU.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/KLU.pc.in - KLU.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/KLU.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # KLU_CHOLMOD installation @@ -439,28 +441,30 @@ if ( NOT NCHOLMOD ) # create pkg-config file for KLU_CHOLMOD #--------------------------------------------------------------------------- - set ( prefix "${CMAKE_INSTALL_PREFIX}" ) - set ( exec_prefix "\${prefix}" ) - cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) - if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") - else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") - endif ( ) - cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) - if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") - else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/KLU_CHOLMOD.pc.in + KLU_CHOLMOD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMOD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) - configure_file ( - Config/KLU_CHOLMOD.pc.in - KLU_CHOLMOD.pc - @ONLY - NEWLINE_STYLE LF ) - install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMOD.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) #------------------------------------------------------------------------------- diff --git a/LDL/CMakeLists.txt b/LDL/CMakeLists.txt index 4ef2c2592..9c200bd7f 100644 --- a/LDL/CMakeLists.txt +++ b/LDL/CMakeLists.txt @@ -194,28 +194,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/LDL.pc.in + LDL.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/LDL.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/LDL.pc.in - LDL.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/LDL.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt index 21cd4fb35..845b23151 100644 --- a/Mongoose/CMakeLists.txt +++ b/Mongoose/CMakeLists.txt @@ -492,28 +492,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/Mongoose.pc.in + Mongoose.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/Mongoose.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/Mongoose.pc.in - Mongoose.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/Mongoose.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # report status diff --git a/RBio/CMakeLists.txt b/RBio/CMakeLists.txt index 29019a49e..a9964f10b 100644 --- a/RBio/CMakeLists.txt +++ b/RBio/CMakeLists.txt @@ -179,28 +179,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/RBio.pc.in + RBio.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/RBio.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/RBio.pc.in - RBio.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/RBio.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/SPEX/CMakeLists.txt b/SPEX/CMakeLists.txt index fe247df16..0ec4666bf 100644 --- a/SPEX/CMakeLists.txt +++ b/SPEX/CMakeLists.txt @@ -236,52 +236,53 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -# This might be something like: -# /usr/lib/libgomp.so;/usr/lib/libpthread.a;m -# convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" -set ( SPEX_STATIC_LIBS_LIST ${SPEX_STATIC_LIBS} ) -set ( SPEX_STATIC_LIBS "" ) -foreach ( _lib ${SPEX_STATIC_LIBS_LIST} ) - string ( FIND ${_lib} "." _pos REVERSE ) - if ( ${_pos} EQUAL "-1" ) - set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_lib}" ) - continue () - endif ( ) - foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) - set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) - if ( ${_lib} MATCHES ${_regex} ) - string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) - if ( NOT "${_libname}" STREQUAL "" ) - set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_libname}" ) - break () +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( SPEX_STATIC_LIBS_LIST ${SPEX_STATIC_LIBS} ) + set ( SPEX_STATIC_LIBS "" ) + foreach ( _lib ${SPEX_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_lib}" ) + continue () endif ( ) - endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) endforeach ( ) -endforeach ( ) -message ( STATUS "SPEX_STATIC_LIBS: ${SPEX_STATIC_LIBS}" ) - -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SPEX.pc.in + SPEX.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPEX.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/SPEX.pc.in - SPEX.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SPEX.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index 29ee4e9cd..e39e783b8 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -361,52 +361,53 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -# This might be something like: -# /usr/lib/libgomp.so;/usr/lib/libpthread.a;m -# convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" -set ( SPQR_STATIC_LIBS_LIST ${SPQR_STATIC_LIBS} ) -set ( SPQR_STATIC_LIBS "" ) -foreach ( _lib ${SPQR_STATIC_LIBS_LIST} ) - string ( FIND ${_lib} "." _pos REVERSE ) - if ( ${_pos} EQUAL "-1" ) - set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_lib}" ) - continue () - endif ( ) - foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) - set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) - if ( ${_lib} MATCHES ${_regex} ) - string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) - if ( NOT "${_libname}" STREQUAL "" ) - set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_libname}" ) - break () - endif ( ) +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( SPQR_STATIC_LIBS_LIST ${SPQR_STATIC_LIBS} ) + set ( SPQR_STATIC_LIBS "" ) + foreach ( _lib ${SPQR_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_lib}" ) + continue () endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) endforeach ( ) -endforeach ( ) -message ( STATUS "SPQR_STATIC_LIBS: ${SPQR_STATIC_LIBS}" ) - -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SPQR.pc.in + SPQR.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPQR.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/SPQR.pc.in - SPQR.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SPQR.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs diff --git a/SPQR/SPQRGPU/CMakeLists.txt b/SPQR/SPQRGPU/CMakeLists.txt index ff23bb5be..ad412736e 100644 --- a/SPQR/SPQRGPU/CMakeLists.txt +++ b/SPQR/SPQRGPU/CMakeLists.txt @@ -150,26 +150,31 @@ install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDAConfigVersion.cmake DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR_CUDA ) +#------------------------------------------------------------------------------- # create pkg-config file -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + ../Config/SPQR_CUDA.pc.in + SPQR_CUDA.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPQR_CUDA.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - ../Config/SPQR_CUDA.pc.in - SPQR_CUDA.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SPQR_CUDA.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) diff --git a/SuiteSparse_GPURuntime/CMakeLists.txt b/SuiteSparse_GPURuntime/CMakeLists.txt index b944bdbd2..062011dcc 100644 --- a/SuiteSparse_GPURuntime/CMakeLists.txt +++ b/SuiteSparse_GPURuntime/CMakeLists.txt @@ -196,28 +196,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SuiteSparse_GPURuntime.pc.in + SuiteSparse_GPURuntime.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntime.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/SuiteSparse_GPURuntime.pc.in - SuiteSparse_GPURuntime.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntime.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # report status diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index b0e365402..551e3867d 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -207,28 +207,30 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SuiteSparse_config.pc.in + SuiteSparse_config.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_config.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/SuiteSparse_config.pc.in - SuiteSparse_config.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_config.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index 98d3ae7a8..778ece0f5 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -317,52 +317,53 @@ install ( FILES # create pkg-config file #------------------------------------------------------------------------------- -# This might be something like: -# /usr/lib/libgomp.so;/usr/lib/libpthread.a;m -# convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" -set ( UMFPACK_STATIC_LIBS_LIST ${UMFPACK_STATIC_LIBS} ) -set ( UMFPACK_STATIC_LIBS "" ) -foreach ( _lib ${UMFPACK_STATIC_LIBS_LIST} ) - string ( FIND ${_lib} "." _pos REVERSE ) - if ( ${_pos} EQUAL "-1" ) - set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_lib}" ) - continue () - endif ( ) - foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) - set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) - if ( ${_lib} MATCHES ${_regex} ) - string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) - if ( NOT "${_libname}" STREQUAL "" ) - set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_libname}" ) - break () - endif ( ) +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( UMFPACK_STATIC_LIBS_LIST ${UMFPACK_STATIC_LIBS} ) + set ( UMFPACK_STATIC_LIBS "" ) + foreach ( _lib ${UMFPACK_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_lib}" ) + continue () endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) endforeach ( ) -endforeach ( ) -message ( STATUS "UMFPACK_STATIC_LIBS: ${UMFPACK_STATIC_LIBS}" ) - -set ( prefix "${CMAKE_INSTALL_PREFIX}" ) -set ( exec_prefix "\${prefix}" ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) -if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") -else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") -endif ( ) -cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) -if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") -else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/UMFPACK.pc.in + UMFPACK.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACK.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) -configure_file ( - Config/UMFPACK.pc.in - UMFPACK.pc - @ONLY - NEWLINE_STYLE LF ) -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/UMFPACK.pc - DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) #------------------------------------------------------------------------------- # Demo library and programs