Skip to content

[fix] Kinetic devel mongocxx c++11 #224

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

Merged
Merged
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
26 changes: 19 additions & 7 deletions libmongocxx_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,34 @@ find_package(OpenSSL REQUIRED)
set(OpenSSL_LIBRARIES ${OPENSSL_LIBRARIES})
set(OpenSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})


if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIB_EXT dylib)
else()
set(LIB_EXT so)
endif()

# for ROS indigo compile mongocxx without c++11 support
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
set(SCONS_CXX11_FLAG "--c++11=on")
message(STATUS "Building with C++11 support")
#for ROS indigo compile mongocxx without c++11 support
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
set(SCONS_CXX11_FLAG "--c++11=on")
message(STATUS "Building with C++11 support")
else()
message(STATUS "ROS Indigo: building without C++11 support")
endif()
else()
message(STATUS "Building without C++11 support")
message(STATUS "Environmental variable ROS_DISTRO not defined, checking OS version")
execute_process(COMMAND lsb_release -cs
OUTPUT_VARIABLE RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT ${RELEASE_CODENAME} STREQUAL "trusty")
set(SCONS_CXX11_FLAG "--c++11=on")
message(STATUS "Building with C++11 support")
else()
message(STATUS "Building without C++11 support")
endif()
endif()


# find MongoClient from system first
# if not found, downloads and compiles from sources
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
Expand Down
20 changes: 18 additions & 2 deletions mongodb_log/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@ cmake_minimum_required(VERSION 2.8.3)
project(mongodb_log)

# for ROS indigo build without C++11 support
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
add_compile_options(-std=c++11)
# for ROS indigo compile without c++11 support
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
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")
execute_process(COMMAND lsb_release -cs OUTPUT_VARIABLE RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${RELEASE_CODENAME} STREQUAL "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")
endif()
endif()

## Find catkin macros and libraries
Expand Down
19 changes: 17 additions & 2 deletions mongodb_store/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@ cmake_minimum_required(VERSION 2.8.3)
project(mongodb_store)

# for ROS indigo compile without c++11 support
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
add_compile_options(-std=c++11)
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
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")
execute_process(COMMAND lsb_release -cs OUTPUT_VARIABLE RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${RELEASE_CODENAME} STREQUAL "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")
endif()
endif()

find_package(catkin REQUIRED COMPONENTS roscpp message_generation rospy std_msgs std_srvs mongodb_store_msgs topic_tools libmongocxx_ros)
Expand Down