Skip to content

Commit

Permalink
Fix compiler error with openCV (C++11) on macOS
Browse files Browse the repository at this point in the history
The OpticalFlow component uses OpenCV, which needs C++11 to compile.
So include(EnableC++XX) must move up above adding the OpticalFlow subdirectory.
  • Loading branch information
jbeyerstedt authored and julianoes committed Apr 1, 2019
1 parent 2f0070e commit e0dfe7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ option(BUILD_ROS_INTERFACE "Enable building ROS dependent plugins" OFF)
option(SEND_VISION_ESTIMATION_DATA "Send Mavlink VISION_POSITION_ESTIMATE msgs" OFF)
option(SEND_ODOMETRY_DATA "Send Mavlink ODOMETRY msgs" OFF)

# Set c++11 or higher
include(EnableC++XX)

## System dependencies are found with CMake's conventions
find_package(Boost 1.58 REQUIRED COMPONENTS system thread timer filesystem)
find_package(gazebo REQUIRED)
Expand Down Expand Up @@ -121,8 +124,6 @@ endif()
###########

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wno-deprecated-declarations")

include(EnableC++XX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")

set(GAZEBO_MSG_INCLUDE_DIRS)
Expand Down

0 comments on commit e0dfe7e

Please sign in to comment.