diff --git a/controller_stopper/CMakeLists.txt b/controller_stopper/CMakeLists.txt index 64caa2e4d..cd6bce085 100644 --- a/controller_stopper/CMakeLists.txt +++ b/controller_stopper/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 2.8.3) project(controller_stopper) -## Compile as C++11, supported in ROS Kinetic and newer -add_compile_options(-std=c++11) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) diff --git a/ur_calibration/CMakeLists.txt b/ur_calibration/CMakeLists.txt index 4b9372ebd..f743b8817 100644 --- a/ur_calibration/CMakeLists.txt +++ b/ur_calibration/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required(VERSION 2.8.3) project(ur_calibration) -## Compile as C++11, supported in ROS Kinetic and newer -add_compile_options(-std=c++11) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + find_package(catkin REQUIRED COMPONENTS roscpp diff --git a/ur_controllers/CMakeLists.txt b/ur_controllers/CMakeLists.txt index 706438b66..6f1b10a37 100644 --- a/ur_controllers/CMakeLists.txt +++ b/ur_controllers/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 2.8.3) project(ur_controllers) -## Compile as C++11, supported in ROS Kinetic and newer -add_compile_options(-std=c++11) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) diff --git a/ur_robot_driver/CMakeLists.txt b/ur_robot_driver/CMakeLists.txt index 5ecaa595f..1cb483a71 100644 --- a/ur_robot_driver/CMakeLists.txt +++ b/ur_robot_driver/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 2.8.12) project(ur_robot_driver) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + add_definitions( -DROS_BUILD ) if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) @@ -59,18 +62,6 @@ catkin_package( Boost ) -# check c++11 / c++0x -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) - add_compile_options(-std=c++11) -elseif(COMPILER_SUPPORTS_CXX0X) - add_compile_options(-std=c++0x) -else() - message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler. Suggested solution: update the pkg build-essential ") -endif() - add_compile_options(-Wall) add_compile_options(-Wextra) add_compile_options(-Wno-unused-parameter)