Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS-O] drastically simplify explicit c++11 check #287

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions mongodb_log/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
cmake_minimum_required(VERSION 2.8.3)
project(mongodb_log)

# for ROS indigo build without C++11 support
# for ROS indigo compile without c++11 support
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
if($ENV{ROS_DISTRO} STREQUAL "kinetic")
add_compile_options(-std=c++11)
message(STATUS "Building with C++11 support")
else()
message(STATUS "ROS Indigo: building without C++11 support")
endif()
else()
message(STATUS "Environmental variable ROS_DISTRO not defined, checking OS version")
file(STRINGS /etc/os-release RELEASE_CODENAME
REGEX "VERSION_CODENAME=")
if(NOT ${RELEASE_CODENAME} MATCHES "trusty")
add_compile_options(-std=c++11)
message(STATUS "OS distro is not trusty: building with C++11 support")
else()
message(STATUS "Ubuntu Trusty: building without C++11 support")
message(STATUS "Building explicitly with C++11 support")
endif()
endif()

Expand Down
17 changes: 2 additions & 15 deletions mongodb_store/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
cmake_minimum_required(VERSION 2.8.3)
project(mongodb_store)

# for ROS indigo compile without c++11 support
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
if($ENV{ROS_DISTRO} STREQUAL "kinetic")
add_compile_options(-std=c++11)
message(STATUS "Building with C++11 support")
else()
message(STATUS "ROS Indigo: building without C++11 support")
endif()
else()
message(STATUS "Environmental variable ROS_DISTRO not defined, checking OS version")
file(STRINGS /etc/os-release RELEASE_CODENAME
REGEX "VERSION_CODENAME=")
if(NOT ${RELEASE_CODENAME} MATCHES "trusty")
add_compile_options(-std=c++11)
message(STATUS "OS distro is not trusty: building with C++11 support")
else()
message(STATUS "Ubuntu Trusty: building without C++11 support")
message(STATUS "Building explicitly with C++11 support")
endif()
endif()

Expand Down