diff --git a/cmake/configs/config_qurt_hil_simple.cmake b/cmake/configs/config_qurt_hil_simple.cmake index ea1c8cc5a5..6068991428 100644 --- a/cmake/configs/config_qurt_hil_simple.cmake +++ b/cmake/configs/config_qurt_hil_simple.cmake @@ -1,4 +1,7 @@ +include(qurt/px4_impl_qurt) + function(px4_set_config_modules out_module_list) + set(config_module_list drivers/device drivers/boards/sitl @@ -81,5 +84,6 @@ function(px4_set_config_modules out_module_list) modules/muorb/adsp ) set(${out_module_list} ${config_module_list} PARENT_SCOPE) + endfunction() diff --git a/cmake/posix/px4_impl_posix.cmake b/cmake/posix/px4_impl_posix.cmake index ed97ab9cb7..1e08a43975 100644 --- a/cmake/posix/px4_impl_posix.cmake +++ b/cmake/posix/px4_impl_posix.cmake @@ -50,7 +50,6 @@ include(common/px4_base) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/posix) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/posix/configs) #============================================================================= # diff --git a/cmake/qurt/px4_impl_qurt.cmake b/cmake/qurt/px4_impl_qurt.cmake index 8fdc3324f5..9857502925 100644 --- a/cmake/qurt/px4_impl_qurt.cmake +++ b/cmake/qurt/px4_impl_qurt.cmake @@ -51,8 +51,9 @@ include(common/px4_base) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt/configs) -include(qurt_funcs) + +px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal") +px4_add_git_submodule(TARGET git_eigen32 PATH "src/lib/eigen-3.2") #============================================================================= # @@ -225,7 +226,8 @@ function(px4_os_prebuild_targets) ONE_VALUE OUT BOARD THREADS REQUIRED OUT BOARD ARGN ${ARGN}) - add_custom_target(${OUT}) + add_custom_target(${OUT} DEPENDS git_dspal git_eigen32) + add_custom_target(ALL DEPENDS git_eigen32) execute_process( WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/eigen-3.2 COMMAND patch -p1 -i ../../../cmake/qurt/qurt_eigen.patch) diff --git a/cmake/qurt/qurt_funcs.cmake b/cmake/qurt/qurt_funcs.cmake index c8a2f46a9f..7ecd0cc818 100644 --- a/cmake/qurt/qurt_funcs.cmake +++ b/cmake/qurt/qurt_funcs.cmake @@ -45,48 +45,6 @@ # # The macros are called from the top level CMakeLists.txt # -set(QURT_APPS_HEADER ${CMAKE_BINARY_DIR}/apps.h) - px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal") px4_add_git_submodule(TARGET git_eigen32 PATH "src/lib/eigen-3.2") -function(px4_target_add_modules out_module_directories) - list(APPEND ${out_module_directories} - ./src/platforms/qurt/px4_layer - ./src/platforms/posix/work_queue - PARENT_SCOPE - ) -endfunction() - -function(px4_target_validate_config) - # FIXME - this can be done in Firmware/CMakeLists.txt - list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt) - - if (NOT EXISTS("${CMAKE_SOURCE_DIR}/cmake/qurt/${TARGET_NAME}.cmake")) - message(FATAL_ERROR "not implemented yet: ${TARGET_NAME}") - endif() -endfunction() - -function(px4_target_firmware) - set(installed_targets) - add_library(dspal_main SHARED ./src/platforms/qurt/px4_layer/main.cpp) - target_link_libraries(dspal_main ${module_list}) - list(APPEND installed_targets dspal_main) -endfunction() - -function(px4_target_rules) - #============================================================================= - # apps - # - add_custom_command(OUTPUT ${QURT_APPS_HEADER} - COMMAND PYTHONPATH=${PYTHONPATH} ${PYTHON_EXECUTABLE} - ${CMAKE_SOURCE_DIR}/Tools/qurt_apps.py > ${QURT_APPS_HEADER} - COMMENT "Generating qurt apps" - VERBATIM - ) - - add_custom_target(qurt_apps DEPENDS ${QURT_APPS_HEADER}) -endfunction() - -function(px4_target_testing) -endfunction() diff --git a/src/firmware/qurt/CMakeLists.txt b/src/firmware/qurt/CMakeLists.txt index fb97327691..f9c53c5853 100644 --- a/src/firmware/qurt/CMakeLists.txt +++ b/src/firmware/qurt/CMakeLists.txt @@ -1,4 +1,4 @@ -include(px4_base) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(V_ARCH v5) set(HEXAGON_TOOLS_ROOT /opt/6.4.03) @@ -33,7 +33,7 @@ set_target_properties(mainapp PROPERTIES LINK_FLAGS ${main_link_flags}) target_link_libraries(mainapp -Wl,--whole-archive - ${module_list} + ${module_libraries} m -Wl,--no-whole-archive -Wl,${TOOLSLIB}/pic/libstdc++.a)