Skip to content

Commit

Permalink
Use CMake 3.2. (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
pifon2a committed Jul 25, 2018
1 parent f61a944 commit 926b854
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
30 changes: 30 additions & 0 deletions cmake/modules/FindEigen3.cmake
Original file line number Diff line number Diff line change
@@ -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()
18 changes: 16 additions & 2 deletions scripts/install_debs_cmake.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Copyright 2016 The Cartographer Authors
#
Expand All @@ -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 \
Expand Down

0 comments on commit 926b854

Please sign in to comment.