update how c++11 requirement is added (#184)
* add c++11 only when it's supported
* skip c++11 check for msvc
James Xu authored 5 years ago
Tully Foote committed 5 years ago
0 | 0 | cmake_minimum_required(VERSION 2.8) |
1 | 1 | project(tf) |
2 | 2 | |
3 | add_compile_options(-std=c++11) | |
3 | include(CheckCXXCompilerFlag) | |
4 | unset(COMPILER_SUPPORTS_CXX11 CACHE) | |
5 | if(MSVC) | |
6 | # https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version | |
7 | # MSVC has c++14 enabled by default, no need to specify c++11 | |
8 | else() | |
9 | check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11) | |
10 | if(COMPILER_SUPPORTS_CXX11) | |
11 | add_compile_options(-std=c++11) | |
12 | endif() | |
13 | endif() | |
4 | 14 | |
5 | 15 | find_package(catkin REQUIRED COMPONENTS |
6 | 16 | angles |