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

if compiler supports it use C++11 #223

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
11 changes: 10 additions & 1 deletion libmongocxx_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ 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")
else()
message(STATUS "Building without C++11 support")
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 Expand Up @@ -51,7 +60,7 @@ else()
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND scons -j ${PROCESSOR_COUNT} --ssl --sharedclient --disable-warnings-as-errors --prefix=${CATKIN_DEVEL_PREFIX} --cpppath=${OPENSSL_INCLUDE_DIR} --libpath=${OPENSSL_ROOT_DIR}/lib install && mkdir -p ${CMAKE_CURRENT_SOURCE_DIR}/include && ${CMAKE_COMMAND} -E copy_directory ${CATKIN_DEVEL_PREFIX}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
BUILD_COMMAND scons -j ${PROCESSOR_COUNT} --ssl --sharedclient --disable-warnings-as-errors --prefix=${CATKIN_DEVEL_PREFIX} --cpppath=${OPENSSL_INCLUDE_DIR} --libpath=${OPENSSL_ROOT_DIR}/lib ${SCONS_CXX11_FLAG} install && mkdir -p ${CMAKE_CURRENT_SOURCE_DIR}/include && ${CMAKE_COMMAND} -E copy_directory ${CATKIN_DEVEL_PREFIX}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
INSTALL_COMMAND ""
)
endif()
Expand Down
5 changes: 5 additions & 0 deletions mongodb_log/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
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)
endif()

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
Expand Down
4 changes: 4 additions & 0 deletions mongodb_store/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
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)
endif()

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

Expand Down