2015-09-08 15:39:13 -07:00
|
|
|
include(px4_base)
|
|
|
|
|
|
|
|
|
|
set(module_dir_list)
|
|
|
|
|
set(module_list)
|
|
|
|
|
px4_posix_add_modules(module_dir_list ${BOARD})
|
|
|
|
|
message(STATUS "module list: ${module_dir_list}")
|
|
|
|
|
|
2015-09-08 20:50:18 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
2015-09-08 15:39:13 -07:00
|
|
|
foreach(directory ${module_dir_list})
|
|
|
|
|
message(STATUS "directory: ${directory}")
|
|
|
|
|
px4_mangle_name(${directory} mangled_name)
|
|
|
|
|
list(APPEND module_list
|
|
|
|
|
${mangled_name})
|
|
|
|
|
endforeach()
|
|
|
|
|
px4_posix_generate_builtin_commands(
|
2015-09-08 19:17:53 -07:00
|
|
|
OUT apps.h
|
2015-09-08 15:39:13 -07:00
|
|
|
MODULE_LIST ${module_list})
|
|
|
|
|
|
2015-09-08 20:50:18 -04:00
|
|
|
add_executable(mainapp
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
|
|
|
|
|
apps.h
|
2015-09-08 19:17:53 -07:00
|
|
|
)
|
2015-09-08 20:50:18 -04:00
|
|
|
|
|
|
|
|
set(main_link_flags
|
|
|
|
|
"-T${CMAKE_SOURCE_DIR}/cmake/posix/ld.script"
|
|
|
|
|
)
|
|
|
|
|
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ")
|
|
|
|
|
set_target_properties(mainapp PROPERTIES LINK_FLAGS ${main_link_flags})
|
|
|
|
|
|
2015-09-08 15:39:13 -07:00
|
|
|
target_link_libraries(mainapp
|
2015-09-08 16:02:07 -07:00
|
|
|
-Wl,--start-group
|
2015-09-08 15:39:13 -07:00
|
|
|
${module_list}
|
|
|
|
|
pthread m
|
2015-09-08 16:02:07 -07:00
|
|
|
-Wl,--end-group
|
2015-09-08 15:39:13 -07:00
|
|
|
)
|
2015-09-08 15:18:59 -04:00
|
|
|
|
|
|
|
|
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|