From 119763cf38093ddc82ae2a9d644e3d975148d908 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Tue, 23 Feb 2021 20:16:52 -0800 Subject: [PATCH] Eliminate CMake FindPackageHandleStandardArgs warnings. CMake complains that the package name does not match when the case differs, e.g.: ``` CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message): The package name passed to `find_package_handle_standard_args` (UMFPACK) does not match the name of the calling package (Umfpack). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/FindUmfpack.cmake:50 (find_package_handle_standard_args) bench/spbench/CMakeLists.txt:24 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. ``` Here we rename the libraries to match their true cases. --- bench/spbench/CMakeLists.txt | 6 +++--- cmake/{FindCholmod.cmake => FindCHOLMOD.cmake} | 2 +- cmake/FindGoogleHash.cmake | 2 +- cmake/FindSuperLU.cmake | 2 +- cmake/{FindUmfpack.cmake => FindUMFPACK.cmake} | 0 test/CMakeLists.txt | 14 +++++++------- unsupported/test/CMakeLists.txt | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) rename cmake/{FindCholmod.cmake => FindCHOLMOD.cmake} (97%) rename cmake/{FindUmfpack.cmake => FindUMFPACK.cmake} (100%) diff --git a/bench/spbench/CMakeLists.txt b/bench/spbench/CMakeLists.txt index fda8dccd9..b1860049c 100644 --- a/bench/spbench/CMakeLists.txt +++ b/bench/spbench/CMakeLists.txt @@ -13,7 +13,7 @@ set(SPARSE_LIBS "") # set(SPARSE_LIBS ${SPARSE_LIBS} ${PARDISO_LIBRARIES}) # endif() -find_package(Cholmod) +find_package(CHOLMOD) if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) add_definitions("-DEIGEN_CHOLMOD_SUPPORT") include_directories(${CHOLMOD_INCLUDES}) @@ -21,7 +21,7 @@ if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) endif() -find_package(Umfpack) +find_package(UMFPACK) if(UMFPACK_FOUND AND BLAS_FOUND) add_definitions("-DEIGEN_UMFPACK_SUPPORT") include_directories(${UMFPACK_INCLUDES}) @@ -37,7 +37,7 @@ if(KLU_FOUND) endif() find_package(SuperLU 4.0) -if(SUPERLU_FOUND AND BLAS_FOUND) +if(SuperLU_FOUND AND BLAS_FOUND) add_definitions("-DEIGEN_SUPERLU_SUPPORT") include_directories(${SUPERLU_INCLUDES}) set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) diff --git a/cmake/FindCholmod.cmake b/cmake/FindCHOLMOD.cmake similarity index 97% rename from cmake/FindCholmod.cmake rename to cmake/FindCHOLMOD.cmake index cea43ec43..e470cb2e0 100644 --- a/cmake/FindCholmod.cmake +++ b/cmake/FindCHOLMOD.cmake @@ -1,4 +1,4 @@ -# Cholmod lib usually requires linking to a blas and lapack library. +# CHOLMOD lib usually requires linking to a blas and lapack library. # It is up to the user of this module to find a BLAS and link to it. if (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES) diff --git a/cmake/FindGoogleHash.cmake b/cmake/FindGoogleHash.cmake index f46ea9c39..481eb4dad 100644 --- a/cmake/FindGoogleHash.cmake +++ b/cmake/FindGoogleHash.cmake @@ -18,6 +18,6 @@ if(GOOGLEHASH_INCLUDES) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GOOGLEHASH DEFAULT_MSG GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE) +find_package_handle_standard_args(GoogleHash DEFAULT_MSG GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE) mark_as_advanced(GOOGLEHASH_INCLUDES) diff --git a/cmake/FindSuperLU.cmake b/cmake/FindSuperLU.cmake index e86fe5cfb..4b779f516 100644 --- a/cmake/FindSuperLU.cmake +++ b/cmake/FindSuperLU.cmake @@ -90,7 +90,7 @@ endif() endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SUPERLU +find_package_handle_standard_args(SuperLU REQUIRED_VARS SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK VERSION_VAR SUPERLU_VERSION_VAR) diff --git a/cmake/FindUmfpack.cmake b/cmake/FindUMFPACK.cmake similarity index 100% rename from cmake/FindUmfpack.cmake rename to cmake/FindUMFPACK.cmake diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c624950c2..f6390e8b3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,26 +41,26 @@ endif() set(SPARSE_LIBS " ") -find_package(Cholmod) +find_package(CHOLMOD) if(CHOLMOD_FOUND) add_definitions("-DEIGEN_CHOLMOD_SUPPORT") include_directories(${CHOLMOD_INCLUDES}) set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${EIGEN_BLAS_LIBRARIES} ${EIGEN_LAPACK_LIBRARIES}) set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${EIGEN_BLAS_LIBRARIES} ${EIGEN_LAPACK_LIBRARIES}) - ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ") + ei_add_property(EIGEN_TESTED_BACKENDS "CHOLMOD, ") else() - ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") + ei_add_property(EIGEN_MISSING_BACKENDS "CHOLMOD, ") endif() -find_package(Umfpack) +find_package(UMFPACK) if(UMFPACK_FOUND) add_definitions("-DEIGEN_UMFPACK_SUPPORT") include_directories(${UMFPACK_INCLUDES}) set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${EIGEN_BLAS_LIBRARIES}) set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${EIGEN_BLAS_LIBRARIES}) - ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ") + ei_add_property(EIGEN_TESTED_BACKENDS "UMFPACK, ") else() - ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") + ei_add_property(EIGEN_MISSING_BACKENDS "UMFPACK, ") endif() find_package(KLU) @@ -75,7 +75,7 @@ else() endif() find_package(SuperLU 4.0) -if(SUPERLU_FOUND) +if(SuperLU_FOUND) add_definitions("-DEIGEN_SUPERLU_SUPPORT") include_directories(${SUPERLU_INCLUDES}) set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${EIGEN_BLAS_LIBRARIES}) diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt index 34aa47d4a..15c21098a 100644 --- a/unsupported/test/CMakeLists.txt +++ b/unsupported/test/CMakeLists.txt @@ -13,7 +13,7 @@ include_directories(../../test ../../unsupported ../../Eigen find_package (Threads) find_package(GoogleHash) -if(GOOGLEHASH_FOUND) +if(GoogleHash_FOUND) add_definitions("-DEIGEN_GOOGLEHASH_SUPPORT") include_directories(${GOOGLEHASH_INCLUDES}) ei_add_property(EIGEN_TESTED_BACKENDS "GoogleHash, ")