···2424 check_ipo_supported(RESULT HAS_IPO)
2525endif()
26262727-find_package(Eigen3 REQUIRED)
2727+# Redundant mention of version is required because module defaults to looking for 2.91-compatible,
2828+# which the config file for a 3.x says it's not compatible with.
2929+find_package(Eigen3 3 REQUIRED)
2830find_package(Vulkan)
2931find_package(EGL)
3032find_package(HIDAPI)
+22
LICENSES/BSD-2-Clause.txt
···11+Copyright (c) <year> <owner>. All rights reserved.
22+33+Redistribution and use in source and binary forms, with or without modification,
44+are permitted provided that the following conditions are met:
55+66+1. Redistributions of source code must retain the above copyright notice,
77+this list of conditions and the following disclaimer.
88+99+2. Redistributions in binary form must reproduce the above copyright notice,
1010+this list of conditions and the following disclaimer in the documentation
1111+and/or other materials provided with the distribution.
1212+1313+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1414+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1515+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1616+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
1717+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1818+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1919+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2020+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2121+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2222+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+108
cmake/FindEigen3.cmake
···11+# - Try to find Eigen3 lib
22+#
33+# This module supports requiring a minimum version, e.g. you can do
44+# find_package(Eigen3 3.1.2)
55+# to require version 3.1.2 or newer of Eigen3.
66+#
77+# Once done this will define
88+#
99+# EIGEN3_FOUND - system has eigen lib with correct version
1010+# EIGEN3_INCLUDE_DIR - the eigen include directory
1111+# EIGEN3_VERSION - eigen version
1212+#
1313+# and the following imported target:
1414+#
1515+# Eigen3::Eigen - The header-only Eigen library
1616+#
1717+# This module reads hints about search locations from
1818+# the following environment variables:
1919+#
2020+# EIGEN3_ROOT
2121+# EIGEN3_ROOT_DIR
2222+2323+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
2424+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
2525+# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
2626+# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
2727+# SPDX-License-Identifier: BSD-2-Clause
2828+2929+if(NOT Eigen3_FIND_VERSION)
3030+ if(NOT Eigen3_FIND_VERSION_MAJOR)
3131+ set(Eigen3_FIND_VERSION_MAJOR 2)
3232+ endif()
3333+ if(NOT Eigen3_FIND_VERSION_MINOR)
3434+ set(Eigen3_FIND_VERSION_MINOR 91)
3535+ endif()
3636+ if(NOT Eigen3_FIND_VERSION_PATCH)
3737+ set(Eigen3_FIND_VERSION_PATCH 0)
3838+ endif()
3939+4040+ set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
4141+endif()
4242+4343+macro(_eigen3_check_version)
4444+ file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
4545+4646+ string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
4747+ set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
4848+ string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
4949+ set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
5050+ string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
5151+ set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
5252+5353+ set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
5454+ if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
5555+ set(EIGEN3_VERSION_OK FALSE)
5656+ else()
5757+ set(EIGEN3_VERSION_OK TRUE)
5858+ endif()
5959+6060+ if(NOT EIGEN3_VERSION_OK)
6161+6262+ message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
6363+ "but at least version ${Eigen3_FIND_VERSION} is required")
6464+ endif()
6565+endmacro()
6666+6767+if (EIGEN3_INCLUDE_DIR)
6868+6969+ # in cache already
7070+ _eigen3_check_version()
7171+ set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
7272+ set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
7373+7474+else ()
7575+7676+ # search first if an Eigen3Config.cmake is available in the system,
7777+ # if successful this would set EIGEN3_INCLUDE_DIR and the rest of
7878+ # the script will work as usual
7979+ find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
8080+8181+ if(NOT EIGEN3_INCLUDE_DIR)
8282+ find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
8383+ HINTS
8484+ ENV EIGEN3_ROOT
8585+ ENV EIGEN3_ROOT_DIR
8686+ PATHS
8787+ ${CMAKE_INSTALL_PREFIX}/include
8888+ ${KDE4_INCLUDE_DIR}
8989+ PATH_SUFFIXES eigen3 eigen
9090+ )
9191+ endif()
9292+9393+ if(EIGEN3_INCLUDE_DIR)
9494+ _eigen3_check_version()
9595+ endif()
9696+9797+ include(FindPackageHandleStandardArgs)
9898+ find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
9999+100100+ mark_as_advanced(EIGEN3_INCLUDE_DIR)
101101+102102+endif()
103103+104104+if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
105105+ add_library(Eigen3::Eigen INTERFACE IMPORTED)
106106+ set_target_properties(Eigen3::Eigen PROPERTIES
107107+ INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
108108+endif()