Skip to content

Commit

Permalink
Merge pull request pal-robotics#3 from achim-k/patch-1
Browse files Browse the repository at this point in the history
Add C++11 compiler flags to CMakeLists.txt
  • Loading branch information
Sammy Pfeiffer authored Jul 18, 2016
2 parents f1e4825 + d8e6690 commit a5a2117
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
cmake_minimum_required(VERSION 2.8.3)
project(gazebo_ros_link_attacher)

#####################################
## Check c++11 / c++0x support ######
#####################################
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
endif()
#####################################

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS
roscpp
Expand Down

0 comments on commit a5a2117

Please sign in to comment.