-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Same mech as in `cmake_modules` package. Issue #139.
- Loading branch information
Showing
5 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This module enables C++11 support | ||
# | ||
# It enable C++0x for older compilers like gcc 4.6, or C++11 for newer | ||
# thanks for: http://www.guyrutenberg.com/2014/01/05/enabling-c11-c0x-in-cmake/ | ||
|
||
include(CheckCXXCompilerFlag) | ||
|
||
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_STD_CXX11) | ||
if (NOT COMPILER_SUPPORTS_STD_CXX11) | ||
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_STD_CXX0X) | ||
endif () | ||
|
||
if (COMPILER_SUPPORTS_STD_CXX11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
elseif (COMPILER_SUPPORTS_STD_CXX0X) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
else () | ||
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") | ||
endif () | ||
|
||
# vim: set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This module includes MAVLink package and | ||
# define MAVLINK_DIALECT required by mavconn_mavlink.h | ||
|
||
find_package(mavlink REQUIRED) | ||
|
||
# fallback for older mavlink package. | ||
if(NOT DEFINED mavlink_DIALECTS) | ||
list(APPEND mavlink_DIALECTS "ardupilotmega") | ||
list(APPEND mavlink_DIALECTS "pixhawk") | ||
list(APPEND mavlink_DIALECTS "common") | ||
endif() | ||
|
||
# Select MAVLink dialect | ||
set(MAVLINK_DIALECT "ardupilotmega" CACHE STRING "MAVLink dialect selector") | ||
set_property(CACHE MAVLINK_DIALECT PROPERTY STRINGS ${mavlink_DIALECTS}) | ||
|
||
# TODO: check that selected dialect are known | ||
|
||
message(STATUS "Selected MAVLink dialect: ${MAVLINK_DIALECT}") | ||
|
||
# define dialect for mavconn_mavlink.h | ||
add_definitions( | ||
-DMAVLINK_DIALECT=${MAVLINK_DIALECT} | ||
) | ||
|
||
# vim: set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Prepend cmake modules from source directory to the cmake module path | ||
list(INSERT CMAKE_MODULE_PATH 0 "@CMAKE_CURRENT_SOURCE_DIR@/cmake/Modules") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Prepend the installed cmake modules to the cmake module path | ||
list(INSERT CMAKE_MODULE_PATH 0 "${mavros_DIR}/../../../@CATKIN_PACKAGE_SHARE_DESTINATION@/cmake/Modules") |