From df747406083c0d2a08d7e2c9b8ad7b93a570e104 Mon Sep 17 00:00:00 2001 From: julie Date: Sun, 9 Feb 2014 00:37:45 +0000 Subject: == Patch provided by Brad King from Kitware - brad.king@kitware.com == Provide CMake packages for both LAPACK and LAPACKE Teach "lapack-config.cmake" to provide variables LAPACK_blas_LIBRARIES LAPACK_lapack_LIBRARIES that contain either the target names when using the reference implementation or the system libraries found for them. Configure a "lapacke-config.cmake" file for the build and install trees to package LAPACKE. Teach it to load the LAPACK package installed with it. Provide variables LAPACKE_INCLUDE_DIRS LAPACKE_LIBRARIES containing the header file search path for lapacke headers and the list of lapacke library targets. This requires CMake 2.8.10 to separate the installation export for the lapacke library from the other targets. --- CMAKE/lapack-config-build.cmake.in | 11 ++++++++++- CMAKE/lapack-config-install.cmake.in | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'CMAKE') diff --git a/CMAKE/lapack-config-build.cmake.in b/CMAKE/lapack-config-build.cmake.in index 8d60cc88..1d084fe1 100644 --- a/CMAKE/lapack-config-build.cmake.in +++ b/CMAKE/lapack-config-build.cmake.in @@ -1 +1,10 @@ -include("@LAPACK_BINARY_DIR@/lapack-targets.cmake") +# Load lapack targets from the build tree if necessary. +set(_LAPACK_TARGET "@_lapack_config_build_guard_target@") +if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}") + include("@LAPACK_BINARY_DIR@/lapack-targets.cmake") +endif() +unset(_LAPACK_TARGET) + +# Report the blas and lapack raw or imported libraries. +set(LAPACK_blas_LIBRARIES "@BLAS_LIBRARIES@") +set(LAPACK_lapack_LIBRARIES "@LAPACK_LIBRARIES@") diff --git a/CMAKE/lapack-config-install.cmake.in b/CMAKE/lapack-config-install.cmake.in index 0c55fc17..4e04f871 100644 --- a/CMAKE/lapack-config-install.cmake.in +++ b/CMAKE/lapack-config-install.cmake.in @@ -1,2 +1,15 @@ -get_filename_component(_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${_SELF_DIR}/lapack-targets.cmake) +# Compute locations from /lib/cmake/lapack-/.cmake +get_filename_component(_LAPACK_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +# Load lapack targets from the install tree if necessary. +set(_LAPACK_TARGET "@_lapack_config_install_guard_target@") +if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}") + include("${_LAPACK_SELF_DIR}/lapack-targets.cmake") +endif() +unset(_LAPACK_TARGET) + +# Report the blas and lapack raw or imported libraries. +set(LAPACK_blas_LIBRARIES "@BLAS_LIBRARIES@") +set(LAPACK_lapack_LIBRARIES "@LAPACK_LIBRARIES@") + +unset(_LAPACK_SELF_DIR) -- cgit v1.2.3