diff options
author | julie <julielangou@users.noreply.github.com> | 2010-08-10 16:57:20 +0000 |
---|---|---|
committer | julie <julielangou@users.noreply.github.com> | 2010-08-10 16:57:20 +0000 |
commit | 4ff24babc1c98305f30b50c4f363fdef3ac7f446 (patch) | |
tree | 3074250a869c5a812abd02afc88e4f7fd3d793c5 | |
parent | 067bfbf1595b1f3e10ae84045791bd58ac1061ec (diff) | |
download | lapack-4ff24babc1c98305f30b50c4f363fdef3ac7f446.tar.gz lapack-4ff24babc1c98305f30b50c4f363fdef3ac7f446.tar.bz2 lapack-4ff24babc1c98305f30b50c4f363fdef3ac7f446.zip |
Patch provided by the kitware team on Aug 5th (Brad King and Bill Hoffman)
Add the install rules and exports the targets.
Now one can write
find_package(LAPACK 3.2.2)
in another project to find either the LAPACK build tree or the
install tree.
-rw-r--r-- | BLAS/SRC/CMakeLists.txt | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 18 | ||||
-rw-r--r-- | SRC/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lapack-config-install.cmake.in | 2 |
4 files changed, 22 insertions, 1 deletions
diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt index 55b5a1c7..e99ff79a 100644 --- a/BLAS/SRC/CMakeLists.txt +++ b/BLAS/SRC/CMakeLists.txt @@ -141,3 +141,4 @@ if(UNIX) target_link_libraries(blas m) endif() target_link_libraries(blas) +lapack_install_library(blas) diff --git a/CMakeLists.txt b/CMakeLists.txt index d733b506..9ad16426 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,14 @@ if (UNIX) endif () endif () +macro(lapack_install_library lib) + install(TARGETS ${lib} EXPORT lapack-targets + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) +endmacro() + # -------------------------------------------------- # Testing @@ -78,3 +86,13 @@ configure_file(${LAPACK_SOURCE_DIR}/lapack-config-version.cmake.in ${LAPACK_BINARY_DIR}/lapack-config-version.cmake @ONLY) configure_file(${LAPACK_SOURCE_DIR}/lapack-config.cmake.in ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY) + +configure_file(${LAPACK_SOURCE_DIR}/lapack-config-install.cmake.in + ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY) +install(FILES + ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake + ${LAPACK_BINARY_DIR}/lapack-config-version.cmake + DESTINATION lib/cmake/lapack-${LAPACK_VERSION} + ) +install(EXPORT lapack-targets + DESTINATION lib/cmake/lapack-${LAPACK_VERSION}) diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt index cc2c8748..3a5d027a 100644 --- a/SRC/CMakeLists.txt +++ b/SRC/CMakeLists.txt @@ -381,4 +381,4 @@ if(BUILD_COMPLEX16) endif() add_library(lapack ${ALLOBJ} ${ALLXOBJ}) target_link_libraries(lapack blas) - +lapack_install_library(lapack) diff --git a/lapack-config-install.cmake.in b/lapack-config-install.cmake.in new file mode 100644 index 00000000..0c55fc17 --- /dev/null +++ b/lapack-config-install.cmake.in @@ -0,0 +1,2 @@ +get_filename_component(_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +include(${_SELF_DIR}/lapack-targets.cmake) |