ardupilot/CMakeLists.txt
2011-09-30 16:55:27 -04:00

45 lines
1.3 KiB
CMake

cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake)
# modify flags from default toolchain flags
set(APM_OPT_FLAGS "-Os -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder")
set(ARDUINO_C_FLAGS "${APM_OPT_FLAGS} -mcall-prologues -ffunction-sections -fdata-sections")
set(ARDUINO_CXX_FLAGS "${APM_OPT_FLAGS} -mcall-prologues -ffunction-sections -fdata-sections -fno-exceptions")
set(ARDUINO_LINKER_FLAGS "${APM_OPT_FLAGS} -Wl,--gc-sections")
project(ArduPilotMega C CXX)
# set default cmake build type to RelWithDebInfo (None Debug Release RelWithDebInfo MinSizeRel)
if( NOT DEFINED CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "RelWithDebInfo" )
endif()
#set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde)
find_package(Arduino 22 REQUIRED)
# determine board being used
if (NOT DEFINED BOARD)
message(STATUS "board not defined, assuming mega, use cmake -DBOARD=mega2560 , etc. to specify")
set(BOARD "mega")
endif()
message(STATUS "Board configured as: ${BOARD}")
# apo
set(apo_ASFLAGS "-assembler-with-cpp")
set(apo_BOARD ${BOARD})
set(apo_LIBS
c
m)
set(apo_SRCS
apo/apo.cpp
)
set(GCS_MAVLink_RECURSE False)
generate_arduino_firmware(apo)