-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change the place of option * Make the dependency of Eigen free * (minor) remove "" for consistency
- Loading branch information
1 parent
9c97f17
commit ec260c2
Showing
5 changed files
with
162 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: | ||
http://www.mozilla.org/MPL/2.0/ | ||
http://www.mozilla.org/MPL/2.0/FAQ.html | ||
|
||
Some files contain third-party code under BSD or LGPL licenses, whence the other | ||
COPYING.* files here. | ||
|
||
All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. | ||
For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. | ||
|
||
If you want to guarantee that the Eigen code that you are #including is licensed | ||
under the MPL2 and possibly more permissive licenses (like BSD), #define this | ||
preprocessor symbol: | ||
EIGEN_MPL2_ONLY | ||
For example, with most compilers, you could add this to your project CXXFLAGS: | ||
-DEIGEN_MPL2_ONLY | ||
This will cause a compilation error to be generated if you #include any code that is | ||
LGPL licensed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 Ignacio Vizzo, Tiziano Guadagnino, Benedikt Mersch, Cyrill | ||
# Stachniss. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
set(EIGEN_BUILD_DOC OFF CACHE BOOL "Don't build Eigen docs") | ||
set(EIGEN_BUILD_TESTING OFF CACHE BOOL "Don't build Eigen tests") | ||
set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") | ||
set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") | ||
set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") | ||
|
||
include(FetchContent) | ||
FetchContent_Declare(eigen URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz | ||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/eigen.patch UPDATE_DISCONNECTED 1) | ||
FetchContent_GetProperties(eigen) | ||
if(NOT eigen_POPULATED) | ||
FetchContent_Populate(eigen) | ||
if(${CMAKE_VERSION} GREATER_EQUAL 3.25) | ||
add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} SYSTEM EXCLUDE_FROM_ALL) | ||
else() | ||
# Emulate the SYSTEM flag introduced in CMake 3.25. Withouth this flag the compiler will | ||
# consider this 3rdparty headers as source code and fail due the -Werror flag. | ||
add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} EXCLUDE_FROM_ALL) | ||
get_target_property(eigen_include_dirs eigen INTERFACE_INCLUDE_DIRECTORIES) | ||
set_target_properties(eigen PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${eigen_include_dirs}") | ||
endif() | ||
endif() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
commit cf82186416d04ea5df2a397d8fe09dc78d40ca65 | ||
Author: Antonio Sánchez <cantonios@google.com> | ||
Date: Sat Mar 5 05:49:45 2022 +0000 | ||
|
||
Adds new CMake Options for controlling build components. | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index de1c23e91..0af36a53a 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -477,6 +477,9 @@ if(EIGEN_BUILD_TESTING) | ||
add_subdirectory(failtest) | ||
endif() | ||
|
||
+include(CMakeDetermineFortranCompiler) | ||
+option(EIGEN_BUILD_BLAS "Toggles the building of the Eigen Blas library" ${CMAKE_Fortran_COMPILER}) | ||
+option(EIGEN_BUILD_LAPACK "Toggles the building of the included Eigen LAPACK library" ${CMAKE_Fortran_COMPILER}) | ||
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) | ||
add_subdirectory(blas) | ||
add_subdirectory(lapack) | ||
@@ -611,6 +614,8 @@ set_target_properties (eigen PROPERTIES EXPORT_NAME Eigen) | ||
|
||
install (TARGETS eigen EXPORT Eigen3Targets) | ||
|
||
+option(EIGEN_BUILD_CMAKE_PACKAGE "Enables the creation of EigenConfig.cmake and related files" ON) | ||
+if(EIGEN_BUILD_CMAKE_PACKAGE) | ||
configure_package_config_file ( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3Config.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake | ||
@@ -655,6 +660,7 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake | ||
# Add uninstall target | ||
add_custom_target ( uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake) | ||
+endif() | ||
|
||
if (EIGEN_SPLIT_TESTSUITE) | ||
ei_split_testsuite("${EIGEN_SPLIT_TESTSUITE}") | ||
diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt | ||
index 8d3cb86dc..c530957fb 100644 | ||
--- a/blas/CMakeLists.txt | ||
+++ b/blas/CMakeLists.txt | ||
@@ -1,6 +1,7 @@ | ||
|
||
project(EigenBlas CXX) | ||
|
||
+if(EIGEN_BUILD_BLAS) | ||
include(CheckLanguage) | ||
check_language(Fortran) | ||
if(CMAKE_Fortran_COMPILER) | ||
@@ -59,4 +60,4 @@ if(EIGEN_BUILD_TESTING) | ||
endif() | ||
|
||
endif() | ||
- | ||
+endif() | ||
diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt | ||
index c8ca64001..8d6d75401 100644 | ||
--- a/lapack/CMakeLists.txt | ||
+++ b/lapack/CMakeLists.txt | ||
@@ -1,5 +1,7 @@ | ||
project(EigenLapack CXX) | ||
|
||
+if(EIGEN_BUILD_LAPACK AND EIGEN_BUILD_BLAS) | ||
+ | ||
include(CheckLanguage) | ||
check_language(Fortran) | ||
if(CMAKE_Fortran_COMPILER) | ||
@@ -457,3 +459,6 @@ if(EXISTS ${eigen_full_path_to_testing_lapack}) | ||
|
||
endif() | ||
|
||
+elseif(EIGEN_BUILD_LAPACK AND NOT EIGEN_BUILD_BLAS) | ||
+ message(FATAL_ERROR "EIGEN_BUILD_LAPACK requires EIGEN_BUILD_BLAS") | ||
+endif() #EIGEN_BUILD_LAPACK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters