Skip to content

Commit 6843952

Browse files
committed
Upgrade vendored Eigen to 3.3.7, and try searching first.
1 parent b2fbb44 commit 6843952

File tree

1,148 files changed

+143154
-45589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,148 files changed

+143154
-45589
lines changed

cmake-local/FindEigen3.cmake

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# - Try to find Eigen3 lib
2+
#
3+
# This module supports requiring a minimum version, e.g. you can do
4+
# find_package(Eigen3 3.1.2)
5+
# to require version 3.1.2 or newer of Eigen3.
6+
#
7+
# Once done this will define
8+
#
9+
# EIGEN3_FOUND - system has eigen lib with correct version
10+
# EIGEN3_INCLUDE_DIR - the eigen include directory
11+
# EIGEN3_VERSION - eigen version
12+
#
13+
# This module reads hints about search locations from
14+
# the following enviroment variables:
15+
#
16+
# EIGEN3_ROOT
17+
# EIGEN3_ROOT_DIR
18+
19+
# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
20+
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
21+
# Copyright (c) 2009 Benoit Jacob <[email protected]>
22+
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
23+
24+
if(NOT Eigen3_FIND_VERSION)
25+
if(NOT Eigen3_FIND_VERSION_MAJOR)
26+
set(Eigen3_FIND_VERSION_MAJOR 2)
27+
endif(NOT Eigen3_FIND_VERSION_MAJOR)
28+
if(NOT Eigen3_FIND_VERSION_MINOR)
29+
set(Eigen3_FIND_VERSION_MINOR 91)
30+
endif(NOT Eigen3_FIND_VERSION_MINOR)
31+
if(NOT Eigen3_FIND_VERSION_PATCH)
32+
set(Eigen3_FIND_VERSION_PATCH 0)
33+
endif(NOT Eigen3_FIND_VERSION_PATCH)
34+
35+
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
36+
endif(NOT Eigen3_FIND_VERSION)
37+
38+
macro(_eigen3_check_version)
39+
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
40+
41+
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
42+
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
43+
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
44+
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
45+
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
46+
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
47+
48+
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
49+
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
50+
set(EIGEN3_VERSION_OK FALSE)
51+
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
52+
set(EIGEN3_VERSION_OK TRUE)
53+
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
54+
55+
if(NOT EIGEN3_VERSION_OK)
56+
57+
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
58+
"but at least version ${Eigen3_FIND_VERSION} is required")
59+
endif(NOT EIGEN3_VERSION_OK)
60+
endmacro(_eigen3_check_version)
61+
62+
if (EIGEN3_INCLUDE_DIR)
63+
64+
# in cache already
65+
_eigen3_check_version()
66+
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
67+
68+
else (EIGEN3_INCLUDE_DIR)
69+
70+
# search first if an Eigen3Config.cmake is available in the system,
71+
# if successful this would set EIGEN3_INCLUDE_DIR and the rest of
72+
# the script will work as usual
73+
find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
74+
75+
if(NOT EIGEN3_INCLUDE_DIR)
76+
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
77+
HINTS
78+
ENV EIGEN3_ROOT
79+
ENV EIGEN3_ROOT_DIR
80+
PATHS
81+
${CMAKE_INSTALL_PREFIX}/include
82+
${KDE4_INCLUDE_DIR}
83+
PATH_SUFFIXES eigen3 eigen
84+
)
85+
endif(NOT EIGEN3_INCLUDE_DIR)
86+
87+
if(EIGEN3_INCLUDE_DIR)
88+
_eigen3_check_version()
89+
endif(EIGEN3_INCLUDE_DIR)
90+
91+
include(FindPackageHandleStandardArgs)
92+
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
93+
94+
mark_as_advanced(EIGEN3_INCLUDE_DIR)
95+
96+
endif(EIGEN3_INCLUDE_DIR)
97+

vendor/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,17 @@ if(WIN32 AND NOT OSVR_OFFICIAL)
138138
target_include_directories(FloatExceptions INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/FloatExceptions")
139139
endif()
140140

141-
# Interface target for Eigen 3.2.8
141+
# Interface target for Eigen
142142
add_library(eigen-headers INTERFACE)
143+
# Bundled 3.3.7
143144
set(OSVR_VENDORED_EIGEN_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/eigen" CACHE INTERNAL "" FORCE)
144-
target_include_directories(eigen-headers INTERFACE "${OSVR_VENDORED_EIGEN_ROOT}")
145145
target_compile_definitions(eigen-headers INTERFACE EIGEN_MPL2_ONLY)
146+
find_package(Eigen3 QUIET)
147+
if(EIGEN3_FOUND)
148+
target_include_directories(eigen-headers INTERFACE "${OSVR_VENDORED_EIGEN_ROOT}")
149+
else()
150+
target_include_directories(eigen-headers INTERFACE "${EIGEN3_INCLUDE_DIR}")
151+
endif()
146152

147153
###
148154
# ETWProviders from UIforETW

vendor/eigen/.hg_archival.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
repo: 8a21fd850624c931e448cbcfb38168cb2717c790
2-
node: 07105f7124f9aef00a68c85e0fc606e65d3d6c15
3-
branch: 3.2
4-
tag: 3.2.8
2+
node: 323c052e17310984a40dda9426e0435bed7178fa
3+
branch: 3.3
4+
tag: 3.3.7

vendor/eigen/.hgeol

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[patterns]
2+
*.sh = LF
3+
*.MINPACK = CRLF
24
scripts/*.in = LF
35
debug/msvc/*.dat = CRLF
6+
debug/msvc/*.natvis = CRLF
47
unsupported/test/mpreal/*.* = CRLF
58
** = native
69

vendor/eigen/.hgignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ core
1313
core.*
1414
*.bak
1515
*~
16-
build*
16+
*build*
1717
*.moc.*
1818
*.moc
1919
ui_*
@@ -30,3 +30,5 @@ log
3030
patch
3131
a
3232
a.*
33+
lapack/testing
34+
lapack/reference

vendor/eigen/.hgtags

+13-10
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ a810d5dbab47acfe65b3350236efdd98f67d4d8a 3.1.0-alpha1
2121
8383e883ebcc6f14695ff0b5e20bb631abab43fb 3.1.0-rc1
2222
bf4cb8c934fa3a79f45f1e629610f0225e93e493 3.1.0-rc2
2323
da195914abcc1d739027cbee7c52077aab30b336 3.2-beta1
24-
4b687cad1d23066f66863f4f87298447298443df 3.2-rc1
25-
1eeda7b1258bcd306018c0738e2b6a8543661141 3.2-rc2
26-
ffa86ffb557094721ca71dcea6aed2651b9fd610 3.2.0
27-
6b38706d90a9fe182e66ab88477b3dbde34b9f66 3.2.1
28-
1306d75b4a21891e59ff9bd96678882cf831e39f 3.2.2
29-
36fd1ba04c120cfdd90f3e4cede47f43b21d19ad 3.2.3
30-
10219c95fe653d4962aa9db4946f6fbea96dd740 3.2.4
31-
bdd17ee3b1b3a166cd5ec36dcad4fc1f3faf774a 3.2.5
32-
c58038c56923e0fd86de3ded18e03df442e66dfb 3.2.6
33-
b30b87236a1b1552af32ac34075ee5696a9b5a33 3.2.7
24+
a8e0d153fc5e239ef8b06e3665f1f9e8cb8d49c8 before-evaluators
25+
09a8e21866106b49c5dec1d6d543e5794e82efa0 3.3-alpha1
26+
ce5a455b34c0a0ac3545a1497cb4a16c38ed90e8 3.3-beta1
27+
69d418c0699907bcd0bf9e0b3ba0a112ed091d85 3.3-beta2
28+
bef509908b9da05d0d07ffc0da105e2c8c6d3996 3.3-rc1
29+
04ab5fa4b241754afcf631117572276444c67239 3.3-rc2
30+
26667be4f70baf4f0d39e96f330714c87b399090 3.3.0
31+
f562a193118d4f40514e2f4a0ace6e974926ef06 3.3.1
32+
da9b4e14c2550e0d11078a3c39e6d56eba9905df 3.3.2
33+
67e894c6cd8f5f1f604b27d37ed47fdf012674ff 3.3.3
34+
5a0156e40feb7c4136680b493c6e433d91a6f355 3.3.4
35+
b3f3d4950030e3fa2e8fde6b68405106ae5685e1 3.3.5
36+
b70bf4fad46787bce88d17d6f80d22f70ac882a1 3.3.6

0 commit comments

Comments
 (0)