forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to project specific cmake lists.
This is better since each project has very different options.
- Loading branch information
Showing
7 changed files
with
173 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set(CMAKE_TOOLCHAIN_FILE ../cmake/ArduinoToolchain.cmake) # Arduino Toolchain | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(ArduCopter C CXX) | ||
|
||
set(PROJECT_VERSION_MAJOR "2") | ||
set(PROJECT_VERSION_MINOR "3") | ||
set(PROJECT_VERSION_PATCH "3") | ||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") | ||
|
||
set(PROJECT_DESCRIPTION "ArduPilotMega based Quadrotor Autopilot.") | ||
|
||
# macro path | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules") | ||
|
||
# common project setup | ||
include(APMProject) |
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,121 @@ | ||
# options | ||
apm_option("APM_PROGRAMMING_PORT" TYPE STRING | ||
DESCRIPTION "Programming upload port?" | ||
DEFAULT "/dev/ttyUSB0") | ||
|
||
apm_option("APM_BOARD" TYPE STRING | ||
DESCRIPTION "ArduPilotMega board?" | ||
DEFAULT "mega2560" | ||
OPTIONS "mega" "mega2560") | ||
|
||
apm_option("APM_FRAME" TYPE STRING | ||
DESCRIPTION "Vehicle type?" | ||
DEFAULT "PLANE_FRAME" | ||
OPTIONS | ||
"PLANE FRAME" | ||
"HELI_FRAME" | ||
"HEXA_FRAME" | ||
"OCTA_FRAME" | ||
"Y6_FRAME" | ||
) | ||
|
||
apm_option("GPS_PROTOCOL" TYPE STRING | ||
DESCRIPTION "GPS protocol?" | ||
DEFAULT "GPS_PROTOCOL_AUTO" | ||
OPTIONS | ||
"GPS_PROTOOCL_NONE" | ||
"GPS_PROTOCOL_AUTO" | ||
"GPS_PROTOCOL_NONE" | ||
"GPS_PROTOCOL_IMU" | ||
"GPS_PROTOCOL_MTK" | ||
"GPS_PROTOCOL_MTK16" | ||
"GPS_PROTOCOL_UBLOX" | ||
"GPS_PROTOCOL_SIRF" | ||
"GPS_PROTOCOL_NMEA") | ||
|
||
apm_option("AIRSPEED_SENSOR" TYPE BOOL | ||
DESCRIPTION "Enable airspeed sensor?" | ||
DEFAULT OFF) | ||
|
||
apm_option("AIRSPEED_RATIO" TYPE STRING ADVANCED | ||
DESCRIPTION "Airspeed ratio?" | ||
DEFAULT "1.9936") | ||
|
||
apm_option("MAGNETOMETER" TYPE BOOL | ||
DESCRIPTION "Enable airspeed sensor?" | ||
DEFAULT OFF) | ||
|
||
apm_option("MAG_ORIENTATION" TYPE STRING ADVANCED | ||
DESCRIPTION "Magnetometer orientation?" | ||
DEFAULT "AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD" | ||
OPTIONS | ||
"AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD" | ||
"AP_COMPASS_COMPONENTS_DOWN_PINS_BACK" | ||
"AP_COMPASS_COMPONENTS_UP_PINS_FORWARD" | ||
"AP_COMPASS_COMPONENTS_UP_PINS_BACK") | ||
|
||
apm_option("HIL_MODE" TYPE STRING | ||
DESCRIPTION "Hardware-in-the-loop- mode?" | ||
DEFAULT "HIL_MODE_DISABLED" | ||
OPTIONS | ||
"HIL_MODE_DISABLED" | ||
"HIL_MODE_ATTITUDE" | ||
"HIL_MODE_SENSORS") | ||
|
||
apm_option("HIL_PORT" TYPE STRING | ||
DESCRIPTION "Port for Hardware-in-the-loop communication" | ||
DEFAULT "0" | ||
OPTIONS "0" "1" "2" "3") | ||
|
||
apm_option("HIL_PROTOCOL" TYPE STRING | ||
DESCRIPTION "Hardware-in-the-loop protocol?" | ||
DEFAULT "HIL_PROTOCOL_MAVLINK" | ||
OPTIONS "HIL_PROTOCOL_MAVLINK" "HIL_PROTOCOL_XPLANE") | ||
|
||
apm_option("GPS_PROTOCOL" TYPE STRING | ||
DESCRIPTION "Ground station protocol?" | ||
DEFAULT "GCS_PROTOCOL_MAVLINK" | ||
OPTIONS "GCS_PROTOCOL_NONE" "GCS_PROTOCOL_MAVLINK") | ||
|
||
apm_option("GCS_PORT" TYPE STRING ADVANCED | ||
DESCRIPTION "Ground station port?" | ||
DESCRIPTION "3" | ||
OPTIONS "0" "1" "2" "3") | ||
|
||
apm_option("MAV_SYSTEM_ID" TYPE STRING ADVANCED | ||
DESCRIPTION "MAVLink System ID?" | ||
DESCRIPTION "1") | ||
|
||
apm_option("SERIAL0_BAUD" TYPE STRING ADVANCED | ||
DESCRIPTION "Serial 0 baudrate?" | ||
DEFAULT "115200" | ||
OPTIONS "57600" "115200") | ||
|
||
apm_option("SERIAL3_BAUD" TYPE STRING ADVANCED | ||
DESCRIPTION "Serial 3 baudrate?" | ||
DEFAULT "57600" | ||
OPTIONS "57600" "115200") | ||
|
||
apm_option("BATTERY_EVENT" TYPE BOOL ADVANCED | ||
DESCRIPTION "Enable low voltage/ high discharge warnings?" | ||
DEFAULT OFF) | ||
|
||
apm_option("LOW_VOLTAGE" TYPE STRING ADVANCED | ||
DESCRIPTION "Voltage to consider low (volts)?" | ||
DEFAULT "9.6") | ||
|
||
apm_option("VOLT_DIV_RATIO" TYPE STRING ADVANCED | ||
DESCRIPTION "Voltage division ratio?" | ||
DEFAULT "3.56") | ||
|
||
apm_option("CUR_AMPS_PER_VOLT" TYPE STRING ADVANCED | ||
DESCRIPTION "Current amps/volt?" | ||
DEFAULT "27.32") | ||
|
||
apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED | ||
DESCRIPTION "Current amps offset?" | ||
DEFAULT "0.0") | ||
|
||
apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED | ||
DESCRIPTION "Current amps offset?" | ||
DEFAULT "0.0") |
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 |
---|---|---|
@@ -1,73 +1,18 @@ | ||
set(CMAKE_TOOLCHAIN_FILE cmake/ArduinoToolchain.cmake) # Arduino Toolchain | ||
set(CMAKE_TOOLCHAIN_FILE ../cmake/ArduinoToolchain.cmake) # Arduino Toolchain | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(ArduPilotMega C CXX) | ||
project(ArduPlane C CXX) | ||
|
||
# set these for release | ||
set(PROJECT_VERSION_MAJOR "2") | ||
set(PROJECT_VERSION_MINOR "3") | ||
set(PROJECT_VERSION_PATCH "3") | ||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") | ||
|
||
set(PROJECT_DESCRIPTION "ArduPilotMega based Airplane Autopilot.") | ||
|
||
# macro path | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules") | ||
|
||
# disallow in-source build | ||
include(MacroEnsureOutOfSourceBuild) | ||
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. | ||
Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.") | ||
|
||
# macros | ||
include(CMakeParseArguments) | ||
include(APMOption) | ||
|
||
# options | ||
apm_option("APM_PROGRAMMING_PORT" TYPE STRING | ||
DESCRIPTION "Programming upload port?" | ||
DEFAULT "/dev/ttyUSB0") | ||
|
||
apm_option("APM_BOARD" TYPE STRING | ||
DESCRIPTION "ArduPilotMega board?" | ||
DEFAULT "mega2560" | ||
OPTIONS "mega" "mega2560") | ||
|
||
apm_option("APM_PROJECT" TYPE STRING | ||
DESCRIPTION "ArduPilotMega project to build?" | ||
DEFAULT "ArduPlane" | ||
OPTIONS "ArduPlane" "ArduCopter") | ||
|
||
include(options.cmake) | ||
|
||
# modify flags from default toolchain flags | ||
set(APM_OPT_FLAGS "-Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${APM_OPT_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${APM_OPT_FLAGS} -Wno-reorder") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${APM_OPT_FLAGS} -Wl,--relax") | ||
|
||
# build apm project | ||
set(${APM_PROJECT}_SKETCH ${CMAKE_SOURCE_DIR}/${APM_PROJECT}) | ||
set(${APM_PROJECT}_BOARD ${APM_BOARD}) | ||
set(${APM_PROJECT}_PORT ${APM_PROGRAMMING_PORT}) | ||
generate_arduino_firmware(${APM_PROJECT}) | ||
|
||
# packaging settings | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A universal autopilot system for the ArduPilotMega board.") | ||
set(CPACK_PACKAGE_VENDOR "DIYDRONES") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]") | ||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.txt") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt") | ||
set(CPACK_PACKAGE_VERSION_MAJOR "${APPLICATION_VERSION_MAJOR}") | ||
set(CPACK_PACKAGE_VERSION_MINOR "${APPLICATION_VERSION_MINOR}") | ||
set(CPACK_PACKAGE_VERSION_PATCH "${APPLICATION_VERSION_PATCH}") | ||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") | ||
set(CPACK_SET_DESTDIR TRUE) | ||
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} | ||
/.git/;/build/;~$;.*\\\\.bin$;.*\\\\.swp$) | ||
set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") | ||
set(CPACK_SOURCE_GENERATOR "ZIP") | ||
set(CPACK_GENERATOR "ZIP") | ||
set(CPACK_PACKAGE_NAME "${APM_PROJECT}_${BOARD}_${HIL_MODE}") | ||
include(CPack) | ||
# common project setup | ||
include(APMProject) |
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
Oops, something went wrong.