Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switched to project specific cmake lists.

This is better since each project has very different options.
  • Loading branch information...
commit 982c10966219e29b0b7cfd267d79d80ba1f3f480 1 parent c0d4955
James Goppert jgoppert authored
18 ArduCopter/CMakeLists.txt
... ... @@ -0,0 +1,18 @@
  1 +set(CMAKE_TOOLCHAIN_FILE ../cmake/ArduinoToolchain.cmake) # Arduino Toolchain
  2 +
  3 +cmake_minimum_required(VERSION 2.8)
  4 +
  5 +project(ArduCopter C CXX)
  6 +
  7 +set(PROJECT_VERSION_MAJOR "2")
  8 +set(PROJECT_VERSION_MINOR "3")
  9 +set(PROJECT_VERSION_PATCH "3")
  10 +set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
  11 +
  12 +set(PROJECT_DESCRIPTION "ArduPilotMega based Quadrotor Autopilot.")
  13 +
  14 +# macro path
  15 +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules")
  16 +
  17 +# common project setup
  18 +include(APMProject)
121 ArduCopter/options.cmake
... ... @@ -0,0 +1,121 @@
  1 +# options
  2 +apm_option("APM_PROGRAMMING_PORT" TYPE STRING
  3 + DESCRIPTION "Programming upload port?"
  4 + DEFAULT "/dev/ttyUSB0")
  5 +
  6 +apm_option("APM_BOARD" TYPE STRING
  7 + DESCRIPTION "ArduPilotMega board?"
  8 + DEFAULT "mega2560"
  9 + OPTIONS "mega" "mega2560")
  10 +
  11 +apm_option("APM_FRAME" TYPE STRING
  12 + DESCRIPTION "Vehicle type?"
  13 + DEFAULT "PLANE_FRAME"
  14 + OPTIONS
  15 + "PLANE FRAME"
  16 + "HELI_FRAME"
  17 + "HEXA_FRAME"
  18 + "OCTA_FRAME"
  19 + "Y6_FRAME"
  20 + )
  21 +
  22 +apm_option("GPS_PROTOCOL" TYPE STRING
  23 + DESCRIPTION "GPS protocol?"
  24 + DEFAULT "GPS_PROTOCOL_AUTO"
  25 + OPTIONS
  26 + "GPS_PROTOOCL_NONE"
  27 + "GPS_PROTOCOL_AUTO"
  28 + "GPS_PROTOCOL_NONE"
  29 + "GPS_PROTOCOL_IMU"
  30 + "GPS_PROTOCOL_MTK"
  31 + "GPS_PROTOCOL_MTK16"
  32 + "GPS_PROTOCOL_UBLOX"
  33 + "GPS_PROTOCOL_SIRF"
  34 + "GPS_PROTOCOL_NMEA")
  35 +
  36 +apm_option("AIRSPEED_SENSOR" TYPE BOOL
  37 + DESCRIPTION "Enable airspeed sensor?"
  38 + DEFAULT OFF)
  39 +
  40 +apm_option("AIRSPEED_RATIO" TYPE STRING ADVANCED
  41 + DESCRIPTION "Airspeed ratio?"
  42 + DEFAULT "1.9936")
  43 +
  44 +apm_option("MAGNETOMETER" TYPE BOOL
  45 + DESCRIPTION "Enable airspeed sensor?"
  46 + DEFAULT OFF)
  47 +
  48 +apm_option("MAG_ORIENTATION" TYPE STRING ADVANCED
  49 + DESCRIPTION "Magnetometer orientation?"
  50 + DEFAULT "AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD"
  51 + OPTIONS
  52 + "AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD"
  53 + "AP_COMPASS_COMPONENTS_DOWN_PINS_BACK"
  54 + "AP_COMPASS_COMPONENTS_UP_PINS_FORWARD"
  55 + "AP_COMPASS_COMPONENTS_UP_PINS_BACK")
  56 +
  57 +apm_option("HIL_MODE" TYPE STRING
  58 + DESCRIPTION "Hardware-in-the-loop- mode?"
  59 + DEFAULT "HIL_MODE_DISABLED"
  60 + OPTIONS
  61 + "HIL_MODE_DISABLED"
  62 + "HIL_MODE_ATTITUDE"
  63 + "HIL_MODE_SENSORS")
  64 +
  65 +apm_option("HIL_PORT" TYPE STRING
  66 + DESCRIPTION "Port for Hardware-in-the-loop communication"
  67 + DEFAULT "0"
  68 + OPTIONS "0" "1" "2" "3")
  69 +
  70 +apm_option("HIL_PROTOCOL" TYPE STRING
  71 + DESCRIPTION "Hardware-in-the-loop protocol?"
  72 + DEFAULT "HIL_PROTOCOL_MAVLINK"
  73 + OPTIONS "HIL_PROTOCOL_MAVLINK" "HIL_PROTOCOL_XPLANE")
  74 +
  75 +apm_option("GPS_PROTOCOL" TYPE STRING
  76 + DESCRIPTION "Ground station protocol?"
  77 + DEFAULT "GCS_PROTOCOL_MAVLINK"
  78 + OPTIONS "GCS_PROTOCOL_NONE" "GCS_PROTOCOL_MAVLINK")
  79 +
  80 +apm_option("GCS_PORT" TYPE STRING ADVANCED
  81 + DESCRIPTION "Ground station port?"
  82 + DESCRIPTION "3"
  83 + OPTIONS "0" "1" "2" "3")
  84 +
  85 +apm_option("MAV_SYSTEM_ID" TYPE STRING ADVANCED
  86 + DESCRIPTION "MAVLink System ID?"
  87 + DESCRIPTION "1")
  88 +
  89 +apm_option("SERIAL0_BAUD" TYPE STRING ADVANCED
  90 + DESCRIPTION "Serial 0 baudrate?"
  91 + DEFAULT "115200"
  92 + OPTIONS "57600" "115200")
  93 +
  94 +apm_option("SERIAL3_BAUD" TYPE STRING ADVANCED
  95 + DESCRIPTION "Serial 3 baudrate?"
  96 + DEFAULT "57600"
  97 + OPTIONS "57600" "115200")
  98 +
  99 +apm_option("BATTERY_EVENT" TYPE BOOL ADVANCED
  100 + DESCRIPTION "Enable low voltage/ high discharge warnings?"
  101 + DEFAULT OFF)
  102 +
  103 +apm_option("LOW_VOLTAGE" TYPE STRING ADVANCED
  104 + DESCRIPTION "Voltage to consider low (volts)?"
  105 + DEFAULT "9.6")
  106 +
  107 +apm_option("VOLT_DIV_RATIO" TYPE STRING ADVANCED
  108 + DESCRIPTION "Voltage division ratio?"
  109 + DEFAULT "3.56")
  110 +
  111 +apm_option("CUR_AMPS_PER_VOLT" TYPE STRING ADVANCED
  112 + DESCRIPTION "Current amps/volt?"
  113 + DEFAULT "27.32")
  114 +
  115 +apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED
  116 + DESCRIPTION "Current amps offset?"
  117 + DEFAULT "0.0")
  118 +
  119 +apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED
  120 + DESCRIPTION "Current amps offset?"
  121 + DEFAULT "0.0")
67 ArduPlane/CMakeLists.txt
... ... @@ -1,73 +1,18 @@
1   -set(CMAKE_TOOLCHAIN_FILE cmake/ArduinoToolchain.cmake) # Arduino Toolchain
  1 +set(CMAKE_TOOLCHAIN_FILE ../cmake/ArduinoToolchain.cmake) # Arduino Toolchain
2 2
3 3 cmake_minimum_required(VERSION 2.8)
4 4
5   -project(ArduPilotMega C CXX)
  5 +project(ArduPlane C CXX)
6 6
7   -# set these for release
8 7 set(PROJECT_VERSION_MAJOR "2")
9 8 set(PROJECT_VERSION_MINOR "3")
10 9 set(PROJECT_VERSION_PATCH "3")
11 10 set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
12 11
  12 +set(PROJECT_DESCRIPTION "ArduPilotMega based Airplane Autopilot.")
  13 +
13 14 # macro path
14 15 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules")
15 16
16   -# disallow in-source build
17   -include(MacroEnsureOutOfSourceBuild)
18   -macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build.
19   -Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
20   -
21   -# macros
22   -include(CMakeParseArguments)
23   -include(APMOption)
24   -
25   -# options
26   -apm_option("APM_PROGRAMMING_PORT" TYPE STRING
27   - DESCRIPTION "Programming upload port?"
28   - DEFAULT "/dev/ttyUSB0")
29   -
30   -apm_option("APM_BOARD" TYPE STRING
31   - DESCRIPTION "ArduPilotMega board?"
32   - DEFAULT "mega2560"
33   - OPTIONS "mega" "mega2560")
34   -
35   -apm_option("APM_PROJECT" TYPE STRING
36   - DESCRIPTION "ArduPilotMega project to build?"
37   - DEFAULT "ArduPlane"
38   - OPTIONS "ArduPlane" "ArduCopter")
39   -
40   -include(options.cmake)
41   -
42   -# modify flags from default toolchain flags
43   -set(APM_OPT_FLAGS "-Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2")
44   -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${APM_OPT_FLAGS}")
45   -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${APM_OPT_FLAGS} -Wno-reorder")
46   -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${APM_OPT_FLAGS} -Wl,--relax")
47   -
48   -# build apm project
49   -set(${APM_PROJECT}_SKETCH ${CMAKE_SOURCE_DIR}/${APM_PROJECT})
50   -set(${APM_PROJECT}_BOARD ${APM_BOARD})
51   -set(${APM_PROJECT}_PORT ${APM_PROGRAMMING_PORT})
52   -generate_arduino_firmware(${APM_PROJECT})
53   -
54   -# packaging settings
55   -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A universal autopilot system for the ArduPilotMega board.")
56   -set(CPACK_PACKAGE_VENDOR "DIYDRONES")
57   -set(CPACK_DEBIAN_PACKAGE_MAINTAINER "james.goppert@gmail.com")
58   -set(CPACK_PACKAGE_CONTACT "james.goppert@gmail.com")
59   -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.txt")
60   -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
61   -set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
62   -set(CPACK_PACKAGE_VERSION_MAJOR "${APPLICATION_VERSION_MAJOR}")
63   -set(CPACK_PACKAGE_VERSION_MINOR "${APPLICATION_VERSION_MINOR}")
64   -set(CPACK_PACKAGE_VERSION_PATCH "${APPLICATION_VERSION_PATCH}")
65   -set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
66   -set(CPACK_SET_DESTDIR TRUE)
67   -set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES}
68   - /.git/;/build/;~$;.*\\\\.bin$;.*\\\\.swp$)
69   -set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
70   -set(CPACK_SOURCE_GENERATOR "ZIP")
71   -set(CPACK_GENERATOR "ZIP")
72   -set(CPACK_PACKAGE_NAME "${APM_PROJECT}_${BOARD}_${HIL_MODE}")
73   -include(CPack)
  17 +# common project setup
  18 +include(APMProject)
41 ArduPlane/options.cmake
@@ -4,19 +4,17 @@
4 4 #option(CLI_SLIDER "Command-line-interface slider support?" OFF)
5 5 #option(APM2 "Build for APM 2.0" OFF)
6 6
7   -# set booleans for project
8   -foreach(PROJECT_NAME "ArduPlane;ArduCopter")
9   - if ("${APM_PROJECT}" STREQUAL "${PROJECT_NAME}")
10   - set(IS_${PROJECT_NAME} true)
11   - else()
12   - set(IS_${PROJECT_NAME} false)
13   - endif()
14   -endforeach()
15   -
16   -if (IS_ARDUCOPTER)
17   -endif()
  7 +# options
  8 +apm_option("APM_PROGRAMMING_PORT" TYPE STRING
  9 + DESCRIPTION "Programming upload port?"
  10 + DEFAULT "/dev/ttyUSB0")
  11 +
  12 +apm_option("APM_BOARD" TYPE STRING
  13 + DESCRIPTION "ArduPilotMega board?"
  14 + DEFAULT "mega2560"
  15 + OPTIONS "mega" "mega2560")
  16 +
18 17 apm_option("APM_FRAME" TYPE STRING
19   - DEPENDS IS_ARDUPLANE
20 18 DESCRIPTION "Vehicle type?"
21 19 DEFAULT "PLANE_FRAME"
22 20 OPTIONS
@@ -28,7 +26,6 @@ apm_option("APM_FRAME" TYPE STRING
28 26 )
29 27
30 28 apm_option("GPS_PROTOCOL" TYPE STRING
31   - DEPENDS IS_ARDUPLANE
32 29 DESCRIPTION "GPS protocol?"
33 30 DEFAULT "GPS_PROTOCOL_AUTO"
34 31 OPTIONS
@@ -43,22 +40,18 @@ apm_option("GPS_PROTOCOL" TYPE STRING
43 40 "GPS_PROTOCOL_NMEA")
44 41
45 42 apm_option("AIRSPEED_SENSOR" TYPE BOOL
46   - DEPENDS IS_ARDUPLANE
47 43 DESCRIPTION "Enable airspeed sensor?"
48 44 DEFAULT OFF)
49 45
50 46 apm_option("AIRSPEED_RATIO" TYPE STRING ADVANCED
51   - DEPENDS IS_ARDUPLANE
52 47 DESCRIPTION "Airspeed ratio?"
53 48 DEFAULT "1.9936")
54 49
55 50 apm_option("MAGNETOMETER" TYPE BOOL
56   - DEPENDS IS_ARDUPLANE
57 51 DESCRIPTION "Enable airspeed sensor?"
58 52 DEFAULT OFF)
59 53
60 54 apm_option("MAG_ORIENTATION" TYPE STRING ADVANCED
61   - DEPENDS IS_ARDUPLANE
62 55 DESCRIPTION "Magnetometer orientation?"
63 56 DEFAULT "AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD"
64 57 OPTIONS
@@ -68,7 +61,6 @@ apm_option("MAG_ORIENTATION" TYPE STRING ADVANCED
68 61 "AP_COMPASS_COMPONENTS_UP_PINS_BACK")
69 62
70 63 apm_option("HIL_MODE" TYPE STRING
71   - DEPENDS IS_ARDUPLANE
72 64 DESCRIPTION "Hardware-in-the-loop- mode?"
73 65 DEFAULT "HIL_MODE_DISABLED"
74 66 OPTIONS
@@ -77,73 +69,60 @@ apm_option("HIL_MODE" TYPE STRING
77 69 "HIL_MODE_SENSORS")
78 70
79 71 apm_option("HIL_PORT" TYPE STRING
80   - DEPENDS IS_ARDUPLANE
81 72 DESCRIPTION "Port for Hardware-in-the-loop communication"
82 73 DEFAULT "0"
83 74 OPTIONS "0" "1" "2" "3")
84 75
85 76 apm_option("HIL_PROTOCOL" TYPE STRING
86   - DEPENDS IS_ARDUPLANE
87 77 DESCRIPTION "Hardware-in-the-loop protocol?"
88 78 DEFAULT "HIL_PROTOCOL_MAVLINK"
89 79 OPTIONS "HIL_PROTOCOL_MAVLINK" "HIL_PROTOCOL_XPLANE")
90 80
91 81 apm_option("GPS_PROTOCOL" TYPE STRING
92   - DEPENDS IS_ARDUPLANE
93 82 DESCRIPTION "Ground station protocol?"
94 83 DEFAULT "GCS_PROTOCOL_MAVLINK"
95 84 OPTIONS "GCS_PROTOCOL_NONE" "GCS_PROTOCOL_MAVLINK")
96 85
97 86 apm_option("GCS_PORT" TYPE STRING ADVANCED
98   - DEPENDS IS_ARDUPLANE
99 87 DESCRIPTION "Ground station port?"
100 88 DESCRIPTION "3"
101 89 OPTIONS "0" "1" "2" "3")
102 90
103 91 apm_option("MAV_SYSTEM_ID" TYPE STRING ADVANCED
104   - DEPENDS IS_ARDUPLANE
105 92 DESCRIPTION "MAVLink System ID?"
106 93 DESCRIPTION "1")
107 94
108 95 apm_option("SERIAL0_BAUD" TYPE STRING ADVANCED
109   - DEPENDS IS_ARDUPLANE
110 96 DESCRIPTION "Serial 0 baudrate?"
111 97 DEFAULT "115200"
112 98 OPTIONS "57600" "115200")
113 99
114 100 apm_option("SERIAL3_BAUD" TYPE STRING ADVANCED
115   - DEPENDS IS_ARDUPLANE
116 101 DESCRIPTION "Serial 3 baudrate?"
117 102 DEFAULT "57600"
118 103 OPTIONS "57600" "115200")
119 104
120 105 apm_option("BATTERY_EVENT" TYPE BOOL ADVANCED
121   - DEPENDS IS_ARDUPLANE
122 106 DESCRIPTION "Enable low voltage/ high discharge warnings?"
123 107 DEFAULT OFF)
124 108
125 109 apm_option("LOW_VOLTAGE" TYPE STRING ADVANCED
126   - DEPENDS IS_ARDUPLANE
127 110 DESCRIPTION "Voltage to consider low (volts)?"
128 111 DEFAULT "9.6")
129 112
130 113 apm_option("VOLT_DIV_RATIO" TYPE STRING ADVANCED
131   - DEPENDS IS_ARDUPLANE
132 114 DESCRIPTION "Voltage division ratio?"
133 115 DEFAULT "3.56")
134 116
135 117 apm_option("CUR_AMPS_PER_VOLT" TYPE STRING ADVANCED
136   - DEPENDS IS_ARDUPLANE
137 118 DESCRIPTION "Current amps/volt?"
138 119 DEFAULT "27.32")
139 120
140 121 apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED
141   - DEPENDS IS_ARDUPLANE
142 122 DESCRIPTION "Current amps offset?"
143 123 DEFAULT "0.0")
144 124
145 125 apm_option("CUR_AMPS_OFFSET" TYPE STRING ADVANCED
146   - DEPENDS IS_ARDUPLANE
147 126 DESCRIPTION "Current amps offset?"
148 127 DEFAULT "0.0")
149 128
12 README.txt
@@ -13,17 +13,17 @@ Building using make
13 13
14 14 Building using cmake
15 15 -----------------------------------------------
  16 + - cd ArduPlane (ArduCopter etc ..)
16 17 - mkdir build
17 18 - cd build
18   - - cmake .. -DBOARD=mega -DPORT=/dev/ttyUSB0
  19 + - cmake .. -DAPM_BOARD=mega -DAPM_PORT=/dev/ttyUSB0
19 20 You can select from mega/mega2560.
20 21 If you have arduino installed in a non-standard location you by specify it by using:
21 22 -DARDUINO_SDK_PATH=/path/to/arduino ..
22   - - make (will build every sketch)
23   - - make ArduPlane (will build just ArduPlane etc.)
24   - - make ArduPloat-upload (will upload the sketch)
  23 + - make (will build the sketch)
  24 + - make ArduPlane-upload (will upload the sketch ArduPlane etc.)
25 25
26   - If you have a sync error during upload reset the board/power cycle the board
  26 + If you have a sync error during upload reset the board or power cycle the board
27 27 before the upload starts.
28 28
29 29
@@ -42,6 +42,8 @@ Building using eclipse
42 42 cd /home/name/apm-build
43 43 cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../apm-src -D BOARD=mega -D PORT=/dev/ttyUSB0
44 44
  45 + Here apm-src can be any sketch, ArduPlane/ ArduCopter etc.
  46 +
45 47 Note: Unix can be substituted for MinGW/ MSYS/ NMake (for windows)
46 48 (see http://www.vtk.org/Wiki/Eclipse_CDT4_Generator)
47 49
2  cmake/Platform/Arduino.cmake
@@ -454,7 +454,7 @@ function(find_arduino_libraries VAR_NAME SRCS)
454 454 get_property(LIBRARY_SEARCH_PATH
455 455 DIRECTORY # Property Scope
456 456 PROPERTY LINK_DIRECTORIES)
457   - foreach(LIB_SEARCH_PATH ${LIBRARY_SEARCH_PATH} ${ARDUINO_LIBRARIES_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libraries)
  457 + foreach(LIB_SEARCH_PATH ${LIBRARY_SEARCH_PATH} ${ARDUINO_LIBRARIES_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libraries ${ARDUINO_EXTRA_LIBRARIES_PATH})
458 458 if(EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/${CMAKE_MATCH_1})
459 459 list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME})
460 460 break()
49 CMakeLists.txt → cmake/modules/APMProject.cmake
... ... @@ -1,19 +1,3 @@
1   -set(CMAKE_TOOLCHAIN_FILE cmake/ArduinoToolchain.cmake) # Arduino Toolchain
2   -
3   -cmake_minimum_required(VERSION 2.8)
4   -
5   -project(ArduPilotMega C CXX)
6   -
7   -# set these for release
8   -set(PROJECT_VERSION_MAJOR "2")
9   -set(PROJECT_VERSION_MINOR "3")
10   -set(PROJECT_VERSION_PATCH "3")
11   -set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
12   -
13   -
14   -# macro path
15   -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
16   -
17 1 # disallow in-source build
18 2 include(MacroEnsureOutOfSourceBuild)
19 3 macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build.
@@ -24,21 +8,7 @@ include(CMakeParseArguments)
24 8 include(APMOption)
25 9
26 10 # options
27   -apm_option("APM_PROGRAMMING_PORT" TYPE STRING
28   - DESCRIPTION "Programming upload port?"
29   - DEFAULT "/dev/ttyUSB0")
30   -
31   -apm_option("APM_BOARD" TYPE STRING
32   - DESCRIPTION "ArduPilotMega board?"
33   - DEFAULT "mega2560"
34   - OPTIONS "mega" "mega2560")
35   -
36   -apm_option("APM_PROJECT" TYPE STRING
37   - DESCRIPTION "ArduPilotMega project to build?"
38   - DEFAULT "ArduPlane"
39   - OPTIONS "ArduPlane" "ArduCopter")
40   -
41   -include(cmake/options-ArduPlane.cmake)
  11 +include(options.cmake)
42 12
43 13 # modify flags from default toolchain flags
44 14 set(APM_OPT_FLAGS "-Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2")
@@ -47,19 +17,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${APM_OPT_FLAGS} -Wno-reorder")
47 17 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${APM_OPT_FLAGS} -Wl,--relax")
48 18
49 19 # build apm project
50   -set(${APM_PROJECT}_SKETCH ${CMAKE_SOURCE_DIR}/${APM_PROJECT})
51   -set(${APM_PROJECT}_BOARD ${APM_BOARD})
52   -set(${APM_PROJECT}_PORT ${APM_PROGRAMMING_PORT})
53   -generate_arduino_firmware(${APM_PROJECT})
  20 +set(ARDUINO_EXTRA_LIBRARIES_PATH ${CMAKE_SOURCE_DIR}/../libraries)
  21 +set(${PROJECT_NAME}_SKETCH ${CMAKE_SOURCE_DIR}/../${PROJECT_NAME})
  22 +set(${PROJECT_NAME}_BOARD ${APM_BOARD})
  23 +set(${PROJECT_NAME}_PORT ${APM_PROGRAMMING_PORT})
  24 +generate_arduino_firmware(${PROJECT_NAME})
54 25
55 26 # packaging settings
56   -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A universal autopilot system for the ArduPilotMega board.")
  27 +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
57 28 set(CPACK_PACKAGE_VENDOR "DIYDRONES")
58 29 set(CPACK_DEBIAN_PACKAGE_MAINTAINER "james.goppert@gmail.com")
59 30 set(CPACK_PACKAGE_CONTACT "james.goppert@gmail.com")
60   -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.txt")
61   -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
62   -set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
  31 +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/../README.txt")
  32 +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/../COPYING.txt")
  33 +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/../README.txt")
63 34 set(CPACK_PACKAGE_VERSION_MAJOR "${APPLICATION_VERSION_MAJOR}")
64 35 set(CPACK_PACKAGE_VERSION_MINOR "${APPLICATION_VERSION_MINOR}")
65 36 set(CPACK_PACKAGE_VERSION_PATCH "${APPLICATION_VERSION_PATCH}")

0 comments on commit 982c109

Please sign in to comment.
Something went wrong with that request. Please try again.