From 7c0b4d27f159a7f781c31836caa12df17228ec57 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 22 Dec 2020 21:03:14 -0600 Subject: [PATCH] CMake: FindGINKGO: recover full library paths --- cmake/modules/FindGINKGO.cmake | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/cmake/modules/FindGINKGO.cmake b/cmake/modules/FindGINKGO.cmake index 37648a26fe..2ab3fa18da 100644 --- a/cmake/modules/FindGINKGO.cmake +++ b/cmake/modules/FindGINKGO.cmake @@ -43,13 +43,29 @@ SET(CMAKE_MODULE_PATH ${_cmake_module_path}) # unset(GINKGO_CXX_COMPILER) +# +# We'd like to have the full library names but the Ginkgo package only +# exports a list with short names. So check again for every lib and store +# the full path: +# +SET(_libraries "") +FOREACH(_library ${GINKGO_INTERFACE_LINK_LIBRARIES}) + LIST(APPEND _libraries GINKGO_LIBRARY_${_library}) + DEAL_II_FIND_LIBRARY(GINKGO_LIBRARY_${_library} + NAMES ${_library} + HINTS ${GINKGO_INSTALL_LIBRARY_DIR} + NO_DEFAULT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_CMAKE_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH + NO_CMAKE_FIND_ROOT_PATH + ) +ENDFOREACH() + DEAL_II_PACKAGE_HANDLE(GINKGO - LIBRARIES - REQUIRED GINKGO_INTERFACE_LINK_LIBRARIES - INCLUDE_DIRS - REQUIRED GINKGO_INSTALL_INCLUDE_DIR - USER_INCLUDE_DIRS - REQUIRED GINKGO_INSTALL_INCLUDE_DIR - CLEAR - Ginkgo_DIR + LIBRARIES REQUIRED ${_libraries} + INCLUDE_DIRS REQUIRED GINKGO_INSTALL_INCLUDE_DIR + USER_INCLUDE_DIRS REQUIRED GINKGO_INSTALL_INCLUDE_DIR + CLEAR Ginkgo_DIR ${_libraries} ) -- 2.39.5