James Goppert
10 years ago
6 changed files with 85 additions and 84 deletions
@ -1,85 +1,9 @@
@@ -1,85 +1,9 @@
|
||||
#============================================================================= |
||||
# executable |
||||
# |
||||
|
||||
if (${OS} STREQUAL "nuttx") |
||||
|
||||
#============================================================================= |
||||
# module subdirectories, need to include first |
||||
# |
||||
add_subdirectory(./lib) |
||||
add_subdirectory(./drivers) |
||||
add_subdirectory(./platforms) |
||||
add_subdirectory(./systemcmds) |
||||
add_subdirectory(./examples) |
||||
add_subdirectory(./modules) |
||||
|
||||
# a list of modules that will be linked to main |
||||
set(module_list) |
||||
|
||||
if (${LABEL} STREQUAL "simple") |
||||
list(APPEND module_list |
||||
drivers__led |
||||
drivers__device |
||||
platforms__common |
||||
modules__systemlib |
||||
modules__uORB |
||||
examples__px4_simple_app |
||||
lib__mathlib__math__filter |
||||
lib__conversion |
||||
) |
||||
endif() |
||||
|
||||
if (${LABEL} STREQUAL "simple") |
||||
list(APPEND module_list ${module_list_simple}) |
||||
endif() |
||||
|
||||
list(APPEND module_list |
||||
platforms__nuttx |
||||
platforms__nuttx__px4_layer |
||||
drivers__boards__px4fmu-v2 |
||||
drivers__stm32 |
||||
) |
||||
|
||||
px4_nuttx_generate_builtin_commands( |
||||
OUT builtin_commands.c |
||||
MODULE_LIST ${module_list}) |
||||
|
||||
px4_nuttx_generate_romfs(OUT romfs.o |
||||
ROOT ROMFS/px4fmu_common) |
||||
|
||||
# add executable |
||||
add_executable(main builtin_commands.c romfs.o) |
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export) |
||||
set(main_link_flags |
||||
"-T${nuttx_export_dir}/build/ld.script" |
||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/main.map" |
||||
) |
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ") |
||||
set_target_properties(main PROPERTIES LINK_FLAGS ${main_link_flags}) |
||||
|
||||
target_link_libraries(main |
||||
-Wl,--start-group |
||||
${module_list} |
||||
apps nuttx nosys m gcc |
||||
-Wl,--end-group) |
||||
|
||||
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4 |
||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/main) |
||||
|
||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD} |
||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4) |
||||
|
||||
elseif(${OS} STREQUAL "qurt") |
||||
set(module_list) |
||||
px4_qurt_add_modules(module_list ${BOARD}) |
||||
message(STATUS "module list: ${module_list}") |
||||
|
||||
px4_qurt_generate_builtin_commands( |
||||
OUT builtin_commands.c |
||||
MODULE_LIST ${module_list}) |
||||
|
||||
add_executable(mainapp builtin_commands.c) |
||||
endif() |
||||
add_subdirectory(./lib) |
||||
add_subdirectory(./drivers) |
||||
add_subdirectory(./platforms) |
||||
add_subdirectory(./systemcmds) |
||||
add_subdirectory(./examples) |
||||
add_subdirectory(./modules) |
||||
add_subdirectory(./firmware) |
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix : |
||||
|
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(./nuttx) |
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix : |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
# a list of modules that will be linked to main |
||||
set(module_list) |
||||
|
||||
if (${LABEL} STREQUAL "simple") |
||||
list(APPEND module_list |
||||
drivers__led |
||||
drivers__device |
||||
platforms__common |
||||
modules__systemlib |
||||
modules__uORB |
||||
examples__px4_simple_app |
||||
lib__mathlib__math__filter |
||||
lib__conversion |
||||
) |
||||
endif() |
||||
|
||||
if (${LABEL} STREQUAL "simple") |
||||
list(APPEND module_list ${module_list_simple}) |
||||
endif() |
||||
|
||||
list(APPEND module_list |
||||
platforms__nuttx |
||||
platforms__nuttx__px4_layer |
||||
drivers__boards__px4fmu-v2 |
||||
drivers__stm32 |
||||
) |
||||
|
||||
px4_nuttx_generate_builtin_commands( |
||||
OUT builtin_commands.c |
||||
MODULE_LIST ${module_list}) |
||||
|
||||
px4_nuttx_generate_romfs(OUT romfs.o |
||||
ROOT ROMFS/px4fmu_common) |
||||
|
||||
# add executable |
||||
add_executable(firmware_nuttx builtin_commands.c romfs.o) |
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export) |
||||
set(main_link_flags |
||||
"-T${nuttx_export_dir}/build/ld.script" |
||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/main.map" |
||||
) |
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ") |
||||
set_target_properties(firmware_nuttx PROPERTIES LINK_FLAGS ${main_link_flags}) |
||||
|
||||
target_link_libraries(firmware_nuttx |
||||
-Wl,--start-group |
||||
${module_list} |
||||
apps nuttx nosys m gcc |
||||
-Wl,--end-group) |
||||
|
||||
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4 |
||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/main) |
||||
|
||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD} |
||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4) |
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix : |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
#TODO |
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix : |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
set(module_list) |
||||
px4_qurt_add_modules(module_list ${BOARD}) |
||||
message(STATUS "module list: ${module_list}") |
||||
|
||||
px4_qurt_generate_builtin_commands( |
||||
OUT builtin_commands.c |
||||
MODULE_LIST ${module_list}) |
||||
|
||||
add_executable(mainapp builtin_commands.c) |
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix : |
Loading…
Reference in new issue