1# 2# Copyright 2020 The TensorFlow Authors. All Rights Reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# tensorflow-lite uses find_package for this package, so override the system 17# installation and build from source instead. 18include(eigen) 19if(eigen_POPULATED) 20 set(EIGEN_FOUND TRUE) 21 get_target_property(EIGEN_INCLUDE_DIRS eigen INTERFACE_DIRECTORIES) 22 # If using MSVC2015 (14) or below force Eigen to C++11. 23 if(MSVC_VERSION LESS_EQUAL 1900) 24 set(COMPILE_DEFINITIONS "EIGEN_MAX_CPP_VER=11") 25 get_target_property(EIGEN_COMPILE_DEFINITIONS eigen 26 INTERFACE_COMPILE_DEFINITIONS 27 ) 28 if(EIGEN_COMPILE_DEFINITIONS) 29 list(APPEND COMPILE_DEFINITIONS ${EIGEN_COMPILE_DEFINITIONS}) 30 endif() 31 set_property( 32 TARGET 33 eigen 34 PROPERTY 35 INTERFACE_COMPILE_DEFINITIONS 36 ${COMPILE_DEFINITIONS} 37 ) 38 endif() 39 set(EIGEN_LIBRARIES Eigen3::Eigen) 40endif() 41 42