Working on cmake support.

This commit is contained in:
James Goppert 2011-10-29 15:01:05 -04:00
parent 14d27b1e4c
commit 1a8c4a2597
8 changed files with 10 additions and 348 deletions

View File

@ -1,3 +1,4 @@
#line 1 "/home/jgoppert/Projects/ardupilotone/ArduBoat/ArduBoat.pde"
// Libraries
#include <FastSerial.h>
#include <AP_Common.h>
@ -13,13 +14,12 @@
#include <APM_BMP085.h>
#include <ModeFilter.h>
#include <APO.h>
#include <WProgram.h>
// Vehicle Configuration
#include "BoatGeneric.h"
// ArduPilotOne Default Setup
#include "APO_DefaultSetup.h"
#include <WProgram.h>; int main(void) {init();setup();for(;;) loop(); return 0; }
// vim:ts=4:sw=4:expandtab
#line 1 "autogenerated"
#include "WProgram.h"

View File

@ -13,7 +13,6 @@
#include <APM_BMP085.h>
#include <ModeFilter.h>
#include <APO.h>
#include <WProgram.h>
// Vehicle Configuration
#include "BoatGeneric.h"

View File

@ -1,165 +0,0 @@
#=============================================================================#
# Author: Niklaa Goddemeier & Sebastian Rohde #
# Date: 04.09.2011 #
#=============================================================================#
set(CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) # CMake module search path
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake) # Arduino Toolchain
#include(ArduinoProcessing)
set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde)
message(STATUS "DIR: ${CMAKE_SOURCE_DIR}")
cmake_minimum_required(VERSION 2.8)
#====================================================================#
# Setup Project #
#====================================================================#
project(ArduCopter C CXX)
find_package(Arduino 22 REQUIRED)
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}")
add_subdirectory(../libraries "${CMAKE_CURRENT_BINARY_DIR}/libs")
#add_subdirectory(${CMAKE_SOURCE_DIR}/ArduCopter)
#add_subdirectory(testtool)
PRINT_BOARD_SETTINGS(${BOARD})
#=============================================================================#
# Author: Niklas Goddemeier & Sebastian Rohde #
# Date: 04.09.2011 #
#=============================================================================#
#====================================================================#
# Settings #
#====================================================================#
set(FIRMWARE_NAME arducopter)
set(${FIRMWARE_NAME}_BOARD ${BOARD}) # Arduino Target board
set(${FIRMWARE_NAME}_SKETCHES
ArduCopter.pde
Attitude.pde
Camera.pde
commands.pde
commands_logic.pde
commands_process.pde
control_modes.pde
events.pde
flip.pde
GCS.pde
GCS_Ardupilot.pde
#GCS_IMU_output.pde
GCS_Jason_text.pde
GCS_Mavlink.pde
GCS_Standard.pde
GCS_Xplane.pde
heli.pde
HIL_Xplane.pde
leds.pde
Log.pde
motors_hexa.pde
motors_octa.pde
motors_octa_quad.pde
motors_quad.pde
motors_tri.pde
motors_y6.pde
navigation.pde
planner.pde
radio.pde
read_commands.pde
sensors.pde
setup.pde
system.pde
test.pde
) # Firmware sketches
#create dummy sourcefile
file(WRITE ${FIRMWARE_NAME}.cpp "// Do not edit")
set(${FIRMWARE_NAME}_SRCS
#test.cpp
${FIRMWARE_NAME}.cpp
) # Firmware sources
set(${FIRMWARE_NAME}_HDRS
APM_Config.h
APM_Config_mavlink_hil.h
APM_Config_xplane.h
config.h
defines.h
GCS.h
HIL.h
Mavlink_Common.h
Parameters.h
) # Firmware sources
set(${FIRMWARE_NAME}_LIBS
DataFlash
AP_Math
PID
RC_Channel
AP_OpticalFlow
ModeFilter
memcheck
#AP_PID
APM_PI
#APO
FastSerial
AP_Common
GCS_MAVLink
AP_GPS
APM_RC
AP_DCM
AP_ADC
AP_Compass
AP_IMU
AP_RangeFinder
APM_BMP085
c
m
)
#${CONSOLE_PORT}
set(${FIRMWARE_NAME}_PORT COM2) # Serial upload port
set(${FIRMWARE_NAME}_SERIAL putty -serial COM2 -sercfg 57600,8,n,1,X ) # Serial terminal cmd
include_directories(
${CMAKE_SOURCE_DIR}/libraries/DataFlash
${CMAKE_SOURCE_DIR}/libraries/AP_Math
${CMAKE_SOURCE_DIR}/libraries/PID
${CMAKE_SOURCE_DIR}/libraries/AP_Common
${CMAKE_SOURCE_DIR}/libraries/RC_Channel
${CMAKE_SOURCE_DIR}/libraries/AP_OpticalFlow
${CMAKE_SOURCE_DIR}/libraries/ModeFilter
${CMAKE_SOURCE_DIR}/libraries/memcheck
#${CMAKE_SOURCE_DIR}/libraries/AP_PID
${CMAKE_SOURCE_DIR}/libraries/APM_PI
${CMAKE_SOURCE_DIR}/libraries/FastSerial
${CMAKE_SOURCE_DIR}/libraries/AP_Compass
${CMAKE_SOURCE_DIR}/libraries/AP_RangeFinder
${CMAKE_SOURCE_DIR}/libraries/AP_GPS
${CMAKE_SOURCE_DIR}/libraries/AP_IMU
${CMAKE_SOURCE_DIR}/libraries/AP_ADC
${CMAKE_SOURCE_DIR}/libraries/AP_DCM
${CMAKE_SOURCE_DIR}/libraries/APM_RC
${CMAKE_SOURCE_DIR}/libraries/GCS_MAVLink
${CMAKE_SOURCE_DIR}/libraries/APM_BMP085
)
#====================================================================#
# Target generation #
#====================================================================#
generate_arduino_firmware(${FIRMWARE_NAME})

View File

@ -1 +0,0 @@
ArduPlane.cpp

View File

@ -1,168 +0,0 @@
#=============================================================================#
# Author: Niklaa Goddemeier & Sebastian Rohde #
# Date: 04.09.2011 #
#=============================================================================#
set(CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) # CMake module search path
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake) # Arduino Toolchain
#include(ArduinoProcessing)
set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde)
message(STATUS "DIR: ${CMAKE_SOURCE_DIR}")
cmake_minimum_required(VERSION 2.8)
#====================================================================#
# Setup Project #
#====================================================================#
project(ArduPlane C CXX)
find_package(Arduino 22 REQUIRED)
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}")
add_subdirectory(../libraries "${CMAKE_CURRENT_BINARY_DIR}/libs")
#add_subdirectory(${CMAKE_SOURCE_DIR}/ArduCopter)
#add_subdirectory(testtool)
PRINT_BOARD_SETTINGS(${BOARD})
#=============================================================================#
# Author: Niklas Goddemeier & Sebastian Rohde #
# Date: 04.09.2011 #
#=============================================================================#
#====================================================================#
# Settings #
#====================================================================#
set(FIRMWARE_NAME ArduPlane)
set(${FIRMWARE_NAME}_BOARD ${BOARD}) # Arduino Target board
set(${FIRMWARE_NAME}_SKETCHES
ArduPlane.pde
Attitude.pde
climb_rate.pde
commands.pde
commands_logic.pde
commands_process.pde
control_modes.pde
events.pde
#flip.pde
#GCS.pde
#GCS_Ardupilot.pde
#GCS_IMU_output.pde
#GCS_Jason_text.pde
GCS_Mavlink.pde
#GCS_Standard.pde
#GCS_Xplane.pde
#heli.pde
#HIL_Xplane.pde
#leds.pde
Log.pde
#motors_hexa.pde
#motors_octa.pde
#motors_octa_quad.pde
#motors_quad.pde
#motors_tri.pde
#motors_y6.pde
navigation.pde
planner.pde
radio.pde
#read_commands.pde
sensors.pde
setup.pde
system.pde
test.pde
) # Firmware sketches
#create dummy sourcefile
file(WRITE ${FIRMWARE_NAME}.cpp "// Do not edit")
set(${FIRMWARE_NAME}_SRCS
#test.cpp
${FIRMWARE_NAME}.cpp
) # Firmware sources
set(${FIRMWARE_NAME}_HDRS
APM_Config.h
APM_Config_mavlink_hil.h
#APM_Config_xplane.h
config.h
defines.h
GCS.h
#HIL.h
#Mavlink_Common.h
Parameters.h
) # Firmware sources
set(${FIRMWARE_NAME}_LIBS
DataFlash
AP_Math
PID
RC_Channel
AP_OpticalFlow
ModeFilter
memcheck
#AP_PID
APM_PI
#APO
FastSerial
AP_Common
GCS_MAVLink
AP_GPS
APM_RC
AP_DCM
AP_ADC
AP_Compass
AP_IMU
AP_RangeFinder
APM_BMP085
c
m
)
#${CONSOLE_PORT}
set(${FIRMWARE_NAME}_PORT COM2) # Serial upload port
set(${FIRMWARE_NAME}_SERIAL putty -serial COM2 -sercfg 57600,8,n,1,X ) # Serial terminal cmd
include_directories(
${CMAKE_SOURCE_DIR}/libraries/DataFlash
${CMAKE_SOURCE_DIR}/libraries/AP_Math
${CMAKE_SOURCE_DIR}/libraries/PID
${CMAKE_SOURCE_DIR}/libraries/AP_Common
${CMAKE_SOURCE_DIR}/libraries/RC_Channel
${CMAKE_SOURCE_DIR}/libraries/AP_OpticalFlow
${CMAKE_SOURCE_DIR}/libraries/ModeFilter
${CMAKE_SOURCE_DIR}/libraries/memcheck
#${CMAKE_SOURCE_DIR}/libraries/AP_PID
${CMAKE_SOURCE_DIR}/libraries/APM_PI
${CMAKE_SOURCE_DIR}/libraries/FastSerial
${CMAKE_SOURCE_DIR}/libraries/AP_Compass
${CMAKE_SOURCE_DIR}/libraries/AP_RangeFinder
${CMAKE_SOURCE_DIR}/libraries/AP_GPS
${CMAKE_SOURCE_DIR}/libraries/AP_IMU
${CMAKE_SOURCE_DIR}/libraries/AP_ADC
${CMAKE_SOURCE_DIR}/libraries/AP_DCM
${CMAKE_SOURCE_DIR}/libraries/APM_RC
${CMAKE_SOURCE_DIR}/libraries/GCS_MAVLink
${CMAKE_SOURCE_DIR}/libraries/APM_BMP085
#new
#${CMAKE_SOURCE_DIR}/libraries/Wire
#${CMAKE_SOURCE_DIR}/libraries/SPI
)
#====================================================================#
# Target generation #
#====================================================================#
generate_arduino_firmware(${FIRMWARE_NAME})

View File

@ -1,3 +1,4 @@
#line 1 "/home/jgoppert/Projects/ardupilotone/ArduRover/ArduRover.pde"
// Libraries
#include <Wire.h>
#include <FastSerial.h>
@ -18,9 +19,9 @@
// Vehicle Configuration
#include "CarStampede.h"
//#include "TankGeneric.h"
// ArduPilotOne Default Setup
#include "APO_DefaultSetup.h"
#include <WProgram.h>; int main(void) {init();setup();for(;;) loop(); return 0; }
// vim:ts=4:sw=4:expandtab
#line 1 "autogenerated"
#include "WProgram.h"

View File

@ -79,13 +79,8 @@ macro(apm_project PROJECT_NAME BOARD SRCS)
message(STATUS "creating apo project ${PROJECT_NAME}")
set(${PROJECT_NAME}_BOARD ${BOARD})
set(${PROJECT_NAME}_AFLAGS "-assembler-with-cpp")
file(GLOB HDRS ${PROJECT_NAME}/*.h)
file(GLOB PDE ${PROJECT_NAME}/*.pde)
set(${PROJECT_NAME}_SRCS ${SRCS} ${HDRS} ${PDE})
set(${PROJECT_NAME}_SRCS ${SRCS})
set(${PROJECT_NAME}_LIBS c)
message(STATUS "sources: ${SRCS}")
message(STATUS "headers: ${HDRS}")
message(STATUS "pde: ${PDE}")
generate_arduino_firmware(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
install(FILES
@ -100,3 +95,5 @@ apm_project(ArduRover ${BOARD} ArduRover/ArduRover.cpp)
apm_project(ArduBoat ${BOARD} ArduBoat/ArduBoat.cpp)
#apm_project(ArduPlane ${BOARD} ArduPlane/ArduPlane.cpp)
#apm_project(ArduCopter ${BOARD} ArduCopter/ArduCopter.cpp)

View File

@ -14,7 +14,6 @@
#include <APM_BMP085.h>
#include <ModeFilter.h>
#include <APO.h>
#include <WProgram.h>
// Vehicle Configuration
//#include "QuadArducopter.h"