diff --git a/CMakeLists.txt b/CMakeLists.txt index d84521e..9c3d564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 2.8.12) # Ships with Ubuntu 14.04 (Trusty) +cmake_minimum_required(VERSION 3.2) project(cartographer) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake new file mode 100644 index 0000000..9838e92 --- /dev/null +++ b/cmake/modules/FindEigen3.cmake @@ -0,0 +1,30 @@ +# Copyright 2018 The Cartographer Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +find_package(Eigen3 QUIET NO_MODULE) +if (NOT EIGEN3_FOUND) + list(APPEND EIGEN3_POSSIBLE_DIRS + /usr/local/include/eigen3 + /usr/include/eigen3 + ) + find_path(EIGEN3_INCLUDE_DIR + NAMES Eigen/Core + PATHS ${EIGEN3_POSSIBLE_DIRS} + ) + if (EIGEN3_INCLUDE_DIR AND EXISTS ${EIGEN3_INCLUDE_DIR}) + set(EIGEN3_FOUND TRUE) + else() + message(WARNING "Failed to find Eigen3. Please, define the path manually.") + endif() +endif() diff --git a/scripts/install_debs_cmake.sh b/scripts/install_debs_cmake.sh index 178aa07..afc0c8d 100755 --- a/scripts/install_debs_cmake.sh +++ b/scripts/install_debs_cmake.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2016 The Cartographer Authors # @@ -19,8 +19,22 @@ set -o verbose # Install the required libraries that are available as debs. sudo apt-get update + +# Install CMake 3.2 for Ubuntu Trusty and Debian Jessie. +sudo apt-get install lsb-release -y +if [[ "$(lsb_release -sc)" = "trusty" ]] +then + sudo apt-get install cmake3 -y +elif [[ "$(lsb_release -sc)" = "jessie" ]] +then + sudo sh -c "echo 'deb http://ftp.debian.org/debian jessie-backports main' >> /etc/apt/sources.list" + sudo apt-get update + sudo apt-get -t jessie-backports install cmake -y +else + sudo apt-get install cmake -y +fi + sudo apt-get install -y \ - cmake \ g++ \ git \ google-mock \