|
| 1 | +commit cf82186416d04ea5df2a397d8fe09dc78d40ca65 |
| 2 | +Author: Antonio Sánchez <cantonios@google.com> |
| 3 | +Date: Sat Mar 5 05:49:45 2022 +0000 |
| 4 | + |
| 5 | + Adds new CMake Options for controlling build components. |
| 6 | + |
| 7 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 8 | +index de1c23e91..0af36a53a 100644 |
| 9 | +--- a/CMakeLists.txt |
| 10 | ++++ b/CMakeLists.txt |
| 11 | +@@ -477,6 +477,9 @@ if(EIGEN_BUILD_TESTING) |
| 12 | + add_subdirectory(failtest) |
| 13 | + endif() |
| 14 | + |
| 15 | ++include(CMakeDetermineFortranCompiler) |
| 16 | ++option(EIGEN_BUILD_BLAS "Toggles the building of the Eigen Blas library" ${CMAKE_Fortran_COMPILER}) |
| 17 | ++option(EIGEN_BUILD_LAPACK "Toggles the building of the included Eigen LAPACK library" ${CMAKE_Fortran_COMPILER}) |
| 18 | + if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) |
| 19 | + add_subdirectory(blas) |
| 20 | + add_subdirectory(lapack) |
| 21 | +@@ -611,6 +614,8 @@ set_target_properties (eigen PROPERTIES EXPORT_NAME Eigen) |
| 22 | + |
| 23 | + install (TARGETS eigen EXPORT Eigen3Targets) |
| 24 | + |
| 25 | ++option(EIGEN_BUILD_CMAKE_PACKAGE "Enables the creation of EigenConfig.cmake and related files" ON) |
| 26 | ++if(EIGEN_BUILD_CMAKE_PACKAGE) |
| 27 | + configure_package_config_file ( |
| 28 | + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3Config.cmake.in |
| 29 | + ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake |
| 30 | +@@ -655,6 +660,7 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake |
| 31 | + # Add uninstall target |
| 32 | + add_custom_target ( uninstall |
| 33 | + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake) |
| 34 | ++endif() |
| 35 | + |
| 36 | + if (EIGEN_SPLIT_TESTSUITE) |
| 37 | + ei_split_testsuite("${EIGEN_SPLIT_TESTSUITE}") |
| 38 | +diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt |
| 39 | +index 8d3cb86dc..c530957fb 100644 |
| 40 | +--- a/blas/CMakeLists.txt |
| 41 | ++++ b/blas/CMakeLists.txt |
| 42 | +@@ -1,6 +1,7 @@ |
| 43 | + |
| 44 | + project(EigenBlas CXX) |
| 45 | + |
| 46 | ++if(EIGEN_BUILD_BLAS) |
| 47 | + include(CheckLanguage) |
| 48 | + check_language(Fortran) |
| 49 | + if(CMAKE_Fortran_COMPILER) |
| 50 | +@@ -59,4 +60,4 @@ if(EIGEN_BUILD_TESTING) |
| 51 | + endif() |
| 52 | + |
| 53 | + endif() |
| 54 | +- |
| 55 | ++endif() |
| 56 | +diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt |
| 57 | +index c8ca64001..8d6d75401 100644 |
| 58 | +--- a/lapack/CMakeLists.txt |
| 59 | ++++ b/lapack/CMakeLists.txt |
| 60 | +@@ -1,5 +1,7 @@ |
| 61 | + project(EigenLapack CXX) |
| 62 | + |
| 63 | ++if(EIGEN_BUILD_LAPACK AND EIGEN_BUILD_BLAS) |
| 64 | ++ |
| 65 | + include(CheckLanguage) |
| 66 | + check_language(Fortran) |
| 67 | + if(CMAKE_Fortran_COMPILER) |
| 68 | +@@ -457,3 +459,6 @@ if(EXISTS ${eigen_full_path_to_testing_lapack}) |
| 69 | + |
| 70 | + endif() |
| 71 | + |
| 72 | ++elseif(EIGEN_BUILD_LAPACK AND NOT EIGEN_BUILD_BLAS) |
| 73 | ++ message(FATAL_ERROR "EIGEN_BUILD_LAPACK requires EIGEN_BUILD_BLAS") |
| 74 | ++endif() #EIGEN_BUILD_LAPACK |
0 commit comments