summaryrefslogtreecommitdiff
path: root/CMAKE
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2014-02-09 00:37:45 +0000
committerjulie <julielangou@users.noreply.github.com>2014-02-09 00:37:45 +0000
commitdf747406083c0d2a08d7e2c9b8ad7b93a570e104 (patch)
treea98b3e15c0f92544337618fbdfc41435c9478b24 /CMAKE
parenta681d8fc7a25c6fc3c90ce0fff72dfd60c23e0f8 (diff)
downloadlapack-df747406083c0d2a08d7e2c9b8ad7b93a570e104.tar.gz
lapack-df747406083c0d2a08d7e2c9b8ad7b93a570e104.tar.bz2
lapack-df747406083c0d2a08d7e2c9b8ad7b93a570e104.zip
== 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.
Diffstat (limited to 'CMAKE')
-rw-r--r--CMAKE/lapack-config-build.cmake.in11
-rw-r--r--CMAKE/lapack-config-install.cmake.in17
2 files changed, 25 insertions, 3 deletions
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 <prefix>/lib/cmake/lapack-<v>/<self>.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)