diff --git a/.gitignore b/.gitignore index ebd471e7e0..7028573613 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ serialsent.raw CMakeFiles CMakeCache.txt cmake_install.cmake +build diff --git a/ArduCopter/.gitignore b/ArduCopter/.gitignore new file mode 100644 index 0000000000..05fd67446c --- /dev/null +++ b/ArduCopter/.gitignore @@ -0,0 +1 @@ +arducopter.cpp diff --git a/ArduCopter/CMakeLists.txt b/ArduCopter/CMakeLists.txt index f13af158d8..78dedcb342 100644 --- a/ArduCopter/CMakeLists.txt +++ b/ArduCopter/CMakeLists.txt @@ -126,8 +126,6 @@ set(${FIRMWARE_NAME}_LIBS c m ) -SET_TARGET_PROPERTIES(AP_Math PROPERTIES LINKER_LANGUAGE CXX) - #${CONSOLE_PORT} set(${FIRMWARE_NAME}_PORT COM2) # Serial upload port diff --git a/ArduPlane/.gitignore b/ArduPlane/.gitignore new file mode 100644 index 0000000000..733b1fe2ff --- /dev/null +++ b/ArduPlane/.gitignore @@ -0,0 +1 @@ +ArduPlane.cpp diff --git a/ArduPlane/CMakeLists.txt b/ArduPlane/CMakeLists.txt index 3b6d496b97..33bddb959a 100644 --- a/ArduPlane/CMakeLists.txt +++ b/ArduPlane/CMakeLists.txt @@ -126,8 +126,6 @@ set(${FIRMWARE_NAME}_LIBS c m ) -SET_TARGET_PROPERTIES(AP_Math PROPERTIES LINKER_LANGUAGE CXX) - #${CONSOLE_PORT} set(${FIRMWARE_NAME}_PORT COM2) # Serial upload port diff --git a/apo/.gitignore b/apo/.gitignore new file mode 100644 index 0000000000..e31d5d5b64 --- /dev/null +++ b/apo/.gitignore @@ -0,0 +1 @@ +apo.cpp diff --git a/apo/CMakeLists.txt b/apo/CMakeLists.txt index f08d48c262..6471926e01 100644 --- a/apo/CMakeLists.txt +++ b/apo/CMakeLists.txt @@ -1,32 +1,52 @@ -#=============================================================================# -# Author: Sebastian Rohde # -# Date: 30.08.2011 # -#=============================================================================# +cmake_minimum_required(VERSION 2.6) +set(CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../") +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake) -#====================================================================# -# Settings # -#====================================================================# -set(FIRMWARE_NAME apo) +string(REGEX REPLACE ".*/" "" PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR}) +project(${PROJECT_NAME} C CXX) +set(FIRMWARE_NAME ${PROJECT_NAME}) -set(${FIRMWARE_NAME}_BOARD ${BOARD}) # Arduino Target board +set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde) -set(${FIRMWARE_NAME}_SKETCHES - apo.pde - ) # Firmware sketches +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}") + +# need to configure based on host operating system +set(${PROJECT_NAME}_PORT COM2) +set(${PROJECT_NAME}_SERIAL putty -serial COM2 -sercfg 57600,8,n,1,X ) -set(${FIRMWARE_NAME}_SRCS - ) # Firmware sources - -set(${FIRMWARE_NAME}_HDRS - ControllerPlane.h - ControllerQuad.h - PlaneEasystar.h - QuadArducopter.h - QuadMikrokopter.h - ) # Firmware sources +include_directories( +${ARDUINO_LIBRARIES_PATH}/Wire +${CMAKE_SOURCE_DIR}/libraries/APO +${CMAKE_SOURCE_DIR}/libraries/AP_Common +${CMAKE_SOURCE_DIR}/libraries/FastSerial +${CMAKE_SOURCE_DIR}/libraries/ModeFilter +${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 +) -set(${FIRMWARE_NAME}_LIBS +add_subdirectory(../libraries "${CMAKE_CURRENT_BINARY_DIR}/libs") +file(WRITE ${PROJECT_NAME}.cpp "// Do not edit") +set(${PROJECT_NAME}_BOARD ${BOARD}) +file(GLOB ${PROJECT_NAME}_SKETCHES *.pde) +file(GLOB ${PROJECT_NAME}_SRCS *.cpp) +file(GLOB ${PROJECT_NAME}_HDRS *.h) +set(${PROJECT_NAME}_LIBS + c m APO FastSerial @@ -42,33 +62,10 @@ set(${FIRMWARE_NAME}_LIBS APM_BMP085 ModeFilter ) - -#${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/APO -${CMAKE_SOURCE_DIR}/libraries/AP_Common -${CMAKE_SOURCE_DIR}/libraries/FastSerial -${CMAKE_SOURCE_DIR}/libraries/ModeFilter -${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}) +generate_arduino_firmware(${PROJECT_NAME}) install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${FIRMWARE_NAME}.hex + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.hex DESTINATION bin ) diff --git a/apo/apo.pde b/apo/apo.pde index 233b9513ee..44a1edf0ce 100644 --- a/apo/apo.pde +++ b/apo/apo.pde @@ -1,4 +1,5 @@ // Libraries +#include #include #include #include diff --git a/cmake/modules/ApmMakeLib.cmake b/cmake/modules/ApmMakeLib.cmake new file mode 100644 index 0000000000..4077c0f7f3 --- /dev/null +++ b/cmake/modules/ApmMakeLib.cmake @@ -0,0 +1,7 @@ +string(REGEX REPLACE ".*/" "" LIB_NAME ${CMAKE_CURRENT_SOURCE_DIR}) +#message(STATUS "building lib: ${LIB_NAME}") +file(GLOB ${LIB_NAME}_SRCS *.cpp) +file(GLOB ${LIB_NAME}_HDRS *.h) +set(${LIB_NAME}_BOARD ${BOARD}) +generate_arduino_library(${LIB_NAME}) +set_target_properties(${LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX) diff --git a/cmake/modules/ApmMakeSketch.cmake b/cmake/modules/ApmMakeSketch.cmake new file mode 100644 index 0000000000..e5db60aa11 --- /dev/null +++ b/cmake/modules/ApmMakeSketch.cmake @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 2.6) + +set(CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../") +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake) + +string(REGEX REPLACE ".*/" "" PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR}) +project(${PROJECT_NAME} C CXX) + +set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde) + +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}") + +# need to configure based on host operating system +set(${PROJECT_NAME}_PORT COM2) +set(${PROJECT_NAME}_SERIAL putty -serial COM2 -sercfg 57600,8,n,1,X ) + +include_directories( +${ARDUINO_LIBRARIES_PATH}/Wire +${CMAKE_SOURCE_DIR}/libraries/APO +${CMAKE_SOURCE_DIR}/libraries/AP_Common +${CMAKE_SOURCE_DIR}/libraries/FastSerial +${CMAKE_SOURCE_DIR}/libraries/ModeFilter +${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 +) + +add_subdirectory(../libraries "${CMAKE_CURRENT_BINARY_DIR}/libs") + +set(${PROJECT_NAME}_BOARD ${BOARD}) +file(GLOB ${PROJECT_NAME}_SKETCHES *.pde) +file(GLOB ${PROJECT_NAME}_SRCS *.cpp) +file(GLOB ${PROJECT_NAME}_HDRS *.h) +set(${PROJECT_NAME}_LIBS + c + m + APO + FastSerial + AP_Common + GCS_MAVLink + AP_GPS + APM_RC + AP_DCM + AP_ADC + AP_Compass + AP_IMU + AP_RangeFinder + APM_BMP085 + ModeFilter +) + + + + + +generate_arduino_firmware(${PROJECT_NAME}) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.hex + DESTINATION bin + ) diff --git a/libraries/APM_BMP085/CMakeLists.txt b/libraries/APM_BMP085/CMakeLists.txt index 77b83a3b66..03e7091ff3 100644 --- a/libraries/APM_BMP085/CMakeLists.txt +++ b/libraries/APM_BMP085/CMakeLists.txt @@ -1,22 +1 @@ -set(LIB_NAME APM_BMP085) - -set(${LIB_NAME}_SRCS - APM_BMP085.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - APM_BMP085.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/APM_PI/CMakeLists.txt b/libraries/APM_PI/CMakeLists.txt index 3ccdd81ce6..03e7091ff3 100644 --- a/libraries/APM_PI/CMakeLists.txt +++ b/libraries/APM_PI/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME APM_PI) - -set(${LIB_NAME}_SRCS - APM_PI.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - APM_PI.h - #AP_OpticalFlow_ADNS3080.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/APM_PerfMon/CMakeLists.txt b/libraries/APM_PerfMon/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/APM_PerfMon/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/APM_RC/CMakeLists.txt b/libraries/APM_RC/CMakeLists.txt index 4c3748159f..03e7091ff3 100644 --- a/libraries/APM_RC/CMakeLists.txt +++ b/libraries/APM_RC/CMakeLists.txt @@ -1,22 +1 @@ -set(LIB_NAME APM_RC) - -set(${LIB_NAME}_SRCS - APM_RC.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - APM_RC.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/APO/CMakeLists.txt b/libraries/APO/CMakeLists.txt index ee964b337b..03e7091ff3 100644 --- a/libraries/APO/CMakeLists.txt +++ b/libraries/APO/CMakeLists.txt @@ -1,39 +1 @@ -set(LIB_NAME APO) - -set(${LIB_NAME}_SRCS - AP_Autopilot.cpp - AP_CommLink.cpp - AP_Controller.cpp - AP_Guide.cpp - AP_HardwareAbstractionLayer.cpp - AP_MavlinkCommand.cpp - AP_Navigator.cpp - AP_RcChannel.cpp - APO.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_Autopilot.h - AP_CommLink.h - AP_Controller.h - AP_Guide.h - AP_HardwareAbstractionLayer.h - AP_MavlinkCommand.h - AP_Navigator.h - AP_RcChannel.h - AP_Var_keys.h - APO.h - constants.h - template.h -) - -include_directories( -# ${CMAKE_SOURCE_DIR}/libraries/AP_Common - ${CMAKE_SOURCE_DIR}/libraries/FastSerial - ${CMAKE_SOURCE_DIR}/libraries/ModeFilter -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_ADC/CMakeLists.txt b/libraries/AP_ADC/CMakeLists.txt index 4c72c51e9f..03e7091ff3 100644 --- a/libraries/AP_ADC/CMakeLists.txt +++ b/libraries/AP_ADC/CMakeLists.txt @@ -1,26 +1 @@ -set(LIB_NAME AP_ADC) - -set(${LIB_NAME}_SRCS - AP_ADC_HIL.cpp - AP_ADC_ADS7844.cpp - AP_ADC.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_ADC_HIL.h - AP_ADC_ADS7844.h - AP_ADC.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_Common/CMakeLists.txt b/libraries/AP_Common/CMakeLists.txt index d86ce08985..03e7091ff3 100644 --- a/libraries/AP_Common/CMakeLists.txt +++ b/libraries/AP_Common/CMakeLists.txt @@ -1,33 +1 @@ -set(LIB_NAME AP_Common) - -set(${LIB_NAME}_SRCS - AP_Common.cpp - AP_Loop.cpp - AP_MetaClass.cpp - AP_Var.cpp - AP_Var_menufuncs.cpp - c++.cpp - menu.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_Common.h - AP_Loop.h - AP_MetaClass.h - AP_Var.h - AP_Test.h - c++.h - AP_Vector.h -) - -include_directories( - - - - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - ${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_Compass/CMakeLists.txt b/libraries/AP_Compass/CMakeLists.txt index e12ac20fdb..03e7091ff3 100644 --- a/libraries/AP_Compass/CMakeLists.txt +++ b/libraries/AP_Compass/CMakeLists.txt @@ -1,27 +1 @@ -set(LIB_NAME AP_Compass) - -set(${LIB_NAME}_SRCS - AP_Compass_HIL.cpp - AP_Compass_HMC5843.cpp - Compass.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - Compass.h - AP_Compass_HIL.h - AP_Compass_HMC5843.h - AP_Compass.h - ) - - - -include_directories( - - - - ${ARDUINO_LIBRARIES_PATH}/Wire - #${CMAKE_SOURCE_DIR}/libraries/FastSerial - # -) -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_DCM/CMakeLists.txt b/libraries/AP_DCM/CMakeLists.txt index 2f0ecd2f78..03e7091ff3 100644 --- a/libraries/AP_DCM/CMakeLists.txt +++ b/libraries/AP_DCM/CMakeLists.txt @@ -1,25 +1 @@ -set(LIB_NAME AP_DCM) - -set(${LIB_NAME}_SRCS - AP_DCM.cpp - AP_DCM_HIL.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_DCM.h - AP_DCM_HIL.h - ) - -include_directories( - - - - ${CMAKE_SOURCE_DIR}/libraries/AP_DCM - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_EEPROMB/CMakeLists.txt b/libraries/AP_EEPROMB/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/AP_EEPROMB/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/AP_GPS/CMakeLists.txt b/libraries/AP_GPS/CMakeLists.txt index 56570d2c9c..03e7091ff3 100644 --- a/libraries/AP_GPS/CMakeLists.txt +++ b/libraries/AP_GPS/CMakeLists.txt @@ -1,44 +1 @@ -set(LIB_NAME AP_GPS) - -set(${LIB_NAME}_SRCS - AP_GPS_406.cpp - AP_GPS_Auto.cpp - AP_GPS_HIL.cpp - AP_GPS_IMU.cpp - AP_GPS_MTK.cpp - AP_GPS_MTK16.cpp - AP_GPS_NMEA.cpp - AP_GPS_SIRF.cpp - AP_GPS_UBLOX.cpp - GPS.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_GPS_406.h - AP_GPS_Auto.h - AP_GPS_HIL.h - AP_GPS_IMU.h - AP_GPS_MTK.h - AP_GPS_MTK_Common.h - AP_GPS_MTK16.h - AP_GPS_NMEA.h - AP_GPS_None.h - AP_GPS_Shim.h - AP_GPS_SIRF.h - AP_GPS_UBLOX.h - AP_GPS.h - GPS.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - ${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_IMU/CMakeLists.txt b/libraries/AP_IMU/CMakeLists.txt index 4685ea4511..03e7091ff3 100644 --- a/libraries/AP_IMU/CMakeLists.txt +++ b/libraries/AP_IMU/CMakeLists.txt @@ -1,25 +1 @@ -set(LIB_NAME AP_IMU) - -set(${LIB_NAME}_SRCS - AP_IMU_Oilpan.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_IMU.h - AP_IMU_Shim.h - AP_IMU_Oilpan.h - IMU.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - ${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_Math/CMakeLists.txt b/libraries/AP_Math/CMakeLists.txt index 262bbfd8cc..03e7091ff3 100644 --- a/libraries/AP_Math/CMakeLists.txt +++ b/libraries/AP_Math/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME AP_Math) - -set(${LIB_NAME}_SRCS - - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_Math.h - matrix3.h - vector2.h - vector3.h - ) - -include_directories( - - - -# ${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_Navigation/CMakeLists.txt b/libraries/AP_Navigation/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/AP_Navigation/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/AP_OpticalFlow/CMakeLists.txt b/libraries/AP_OpticalFlow/CMakeLists.txt index 117d84c00d..03e7091ff3 100644 --- a/libraries/AP_OpticalFlow/CMakeLists.txt +++ b/libraries/AP_OpticalFlow/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME AP_OpticalFlow) - -set(${LIB_NAME}_SRCS - AP_OpticalFlow.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_OpticalFlow.h - #AP_OpticalFlow_ADNS3080.h - ) - -include_directories( - - - - ${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_PID/CMakeLists.txt b/libraries/AP_PID/CMakeLists.txt index c38fbea5d3..03e7091ff3 100644 --- a/libraries/AP_PID/CMakeLists.txt +++ b/libraries/AP_PID/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME AP_PID) - -set(${LIB_NAME}_SRCS - AP_PID.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_PID.h - #AP_OpticalFlow_ADNS3080.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/AP_RC/CMakeLists.txt b/libraries/AP_RC/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/AP_RC/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/AP_RC_Channel/CMakeLists.txt b/libraries/AP_RC_Channel/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/AP_RC_Channel/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/AP_RangeFinder/CMakeLists.txt b/libraries/AP_RangeFinder/CMakeLists.txt index 05b5750e33..03e7091ff3 100644 --- a/libraries/AP_RangeFinder/CMakeLists.txt +++ b/libraries/AP_RangeFinder/CMakeLists.txt @@ -1,27 +1 @@ -set(LIB_NAME AP_RangeFinder) - -set(${LIB_NAME}_SRCS - AP_RangeFinder_MaxsonarXL.cpp - AP_RangeFinder_SharpGP2Y.cpp - RangeFinder.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - AP_RangeFinder.h - AP_RangeFinder_MaxsonarXL.h - AP_RangeFinder_SharpGP2Y.h - RangeFinder.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index ed27448a23..0d8ac42886 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,24 +1,34 @@ -add_subdirectory(DataFlash) -add_subdirectory(AP_Math) -add_subdirectory(PID) -add_subdirectory(AP_Common) -add_subdirectory(RC_Channel) -add_subdirectory(AP_OpticalFlow) -add_subdirectory(ModeFilter) -add_subdirectory(memcheck) -add_subdirectory(APM_PI) -add_subdirectory(AP_GPS) -add_subdirectory(AP_DCM) -add_subdirectory(AP_Compass) add_subdirectory(AP_ADC) +add_subdirectory(AP_Common) +add_subdirectory(AP_Compass) +add_subdirectory(AP_DCM) +add_subdirectory(AP_EEPROMB) +add_subdirectory(AP_GPS) add_subdirectory(AP_IMU) -add_subdirectory(AP_RangeFinder) - -add_subdirectory(APM_RC) +add_subdirectory(AP_Math) add_subdirectory(APM_BMP085) - -#add_subdirectory(APO) +add_subdirectory(APM_PerfMon) +add_subdirectory(APM_PI) +add_subdirectory(APM_RC) +add_subdirectory(AP_Navigation) +add_subdirectory(APO) +add_subdirectory(AP_OpticalFlow) +add_subdirectory(AP_PID) +add_subdirectory(AP_RangeFinder) +add_subdirectory(AP_RC) +add_subdirectory(AP_RC_Channel) +add_subdirectory(DataFlash) add_subdirectory(FastSerial) add_subdirectory(GCS_MAVLink) +add_subdirectory(GCS_SIMPLE) +add_subdirectory(GPS_IMU) +add_subdirectory(GPS_MTK) +add_subdirectory(GPS_NMEA) +add_subdirectory(GPS_UBLOX) +add_subdirectory(memcheck) +add_subdirectory(ModeFilter) +add_subdirectory(PID) +add_subdirectory(RC_Channel) +add_subdirectory(Waypoints) +add_subdirectory(Trig_LUT) -#add_subdirectory(playgroundlib) diff --git a/libraries/DataFlash/CMakeLists.txt b/libraries/DataFlash/CMakeLists.txt index d36f3fa8a7..03e7091ff3 100644 --- a/libraries/DataFlash/CMakeLists.txt +++ b/libraries/DataFlash/CMakeLists.txt @@ -1,21 +1 @@ -set(LIB_NAME DataFlash) - -set(${LIB_NAME}_SRCS - DataFlash.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - DataFlash.h - ) - -include_directories( - - - -# ${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/FastSerial/CMakeLists.txt b/libraries/FastSerial/CMakeLists.txt index 1ace8cb81c..03e7091ff3 100644 --- a/libraries/FastSerial/CMakeLists.txt +++ b/libraries/FastSerial/CMakeLists.txt @@ -1,28 +1 @@ -set(LIB_NAME FastSerial) - -set(${LIB_NAME}_SRCS - BetterStream.cpp - FastSerial.cpp - vprintf.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - BetterStream.h - FastSerial.h - ftoa_engine.h - ntz.h - xtoa_fast.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/GCS_MAVLink/CMakeLists.txt b/libraries/GCS_MAVLink/CMakeLists.txt index fcd653fead..03e7091ff3 100644 --- a/libraries/GCS_MAVLink/CMakeLists.txt +++ b/libraries/GCS_MAVLink/CMakeLists.txt @@ -1,19 +1 @@ -set(LIB_NAME GCS_MAVLink) - -set(${LIB_NAME}_SRCS - GCS_MAVLink.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - GCS_MAVLink.h -) - -include_directories( - #${CMAKE_SOURCE_DIR}/libraries/ - ${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/GCS_SIMPLE/CMakeLists.txt b/libraries/GCS_SIMPLE/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/GCS_SIMPLE/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/GPS_IMU/CMakeLists.txt b/libraries/GPS_IMU/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/GPS_IMU/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/GPS_MTK/CMakeLists.txt b/libraries/GPS_MTK/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/GPS_MTK/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/GPS_NMEA/CMakeLists.txt b/libraries/GPS_NMEA/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/GPS_NMEA/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/GPS_UBLOX/CMakeLists.txt b/libraries/GPS_UBLOX/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/GPS_UBLOX/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/ModeFilter/CMakeLists.txt b/libraries/ModeFilter/CMakeLists.txt index cb0c8eb997..03e7091ff3 100644 --- a/libraries/ModeFilter/CMakeLists.txt +++ b/libraries/ModeFilter/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME ModeFilter) - -set(${LIB_NAME}_SRCS - ModeFilter.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - ModeFilter.h - #AP_OpticalFlow_ADNS3080.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - #${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/PID/CMakeLists.txt b/libraries/PID/CMakeLists.txt index 6233d35eb3..03e7091ff3 100644 --- a/libraries/PID/CMakeLists.txt +++ b/libraries/PID/CMakeLists.txt @@ -1,21 +1 @@ -set(LIB_NAME PID) - -set(${LIB_NAME}_SRCS - PID.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - PID.h - ) - -include_directories( - - - - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/RC_Channel/CMakeLists.txt b/libraries/RC_Channel/CMakeLists.txt index 89ff6b9278..03e7091ff3 100644 --- a/libraries/RC_Channel/CMakeLists.txt +++ b/libraries/RC_Channel/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME RC_Channel) - -set(${LIB_NAME}_SRCS - RC_Channel.cpp - RC_Channel_aux.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - RC_Channel.h - RC_Channel_aux.h - ) - -include_directories( - - - - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - ${CMAKE_SOURCE_DIR}/libraries/APM_RC - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib) diff --git a/libraries/Trig_LUT/CMakeLists.txt b/libraries/Trig_LUT/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/Trig_LUT/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/Waypoints/CMakeLists.txt b/libraries/Waypoints/CMakeLists.txt new file mode 100644 index 0000000000..03e7091ff3 --- /dev/null +++ b/libraries/Waypoints/CMakeLists.txt @@ -0,0 +1 @@ +include(ApmMakeLib) diff --git a/libraries/memcheck/CMakeLists.txt b/libraries/memcheck/CMakeLists.txt index a5c1575256..03e7091ff3 100644 --- a/libraries/memcheck/CMakeLists.txt +++ b/libraries/memcheck/CMakeLists.txt @@ -1,24 +1 @@ -set(LIB_NAME memcheck) - -set(${LIB_NAME}_SRCS - memcheck.cpp - #AP_OpticalFlow_ADNS3080.cpp - ) # Firmware sources - -set(${LIB_NAME}_HDRS - memcheck.h - #AP_OpticalFlow_ADNS3080.h - ) - -include_directories( - - - - #${CMAKE_SOURCE_DIR}/libraries/AP_Math - ${CMAKE_SOURCE_DIR}/libraries/AP_Common - #${CMAKE_SOURCE_DIR}/libraries/FastSerial -# - ) - -set(${LIB_NAME}_BOARD ${BOARD}) - -generate_arduino_library(${LIB_NAME}) +include(ApmMakeLib)