From f2189dd04591ff77e0f297e3f13d816aa49a8a2e Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 15 Sep 2019 13:37:55 -0400 Subject: [PATCH] CMakeLists.txt extract top level helpers (ccache, doxygen, metadata, etc) --- CMakeLists.txt | 214 +++-------------------------------------- cmake/ccache.cmake | 51 ++++++++++ cmake/doxygen.cmake | 62 ++++++++++++ cmake/metadata.cmake | 79 +++++++++++++++ cmake/package.cmake | 60 ++++++++++++ cmake/px4_config.cmake | 104 ++++++++++++++++++++ 6 files changed, 368 insertions(+), 202 deletions(-) create mode 100644 cmake/ccache.cmake create mode 100644 cmake/doxygen.cmake create mode 100644 cmake/metadata.cmake create mode 100644 cmake/package.cmake create mode 100644 cmake/px4_config.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a3071a9455..6a6eeb660b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,7 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${PX4_SOURCE_DIR} ) +message(STATUS "PX4 version: ${PX4_GIT_TAG}") define_property(GLOBAL PROPERTY PX4_MODULE_LIBRARIES BRIEF_DOCS "PX4 module libs" @@ -138,79 +139,7 @@ include(px4_add_module) set(config_module_list) set(config_df_driver_list) -# find PX4 config -# look for in tree board config that matches CONFIG input -if(NOT PX4_CONFIG_FILE) - - file(GLOB_RECURSE board_configs - RELATIVE "${PX4_SOURCE_DIR}/boards" - "boards/*.cmake" - ) - - set(PX4_CONFIGS ${board_configs} CACHE STRING "PX4 board configs" FORCE) - - foreach(filename ${board_configs}) - # parse input CONFIG into components to match with existing in tree configs - # the platform prefix (eg nuttx_) is historical, and removed if present - string(REPLACE ".cmake" "" filename_stripped ${filename}) - string(REPLACE "/" ";" config ${filename_stripped}) - list(LENGTH config config_len) - - if(${config_len} EQUAL 3) - - - list(GET config 0 vendor) - list(GET config 1 model) - list(GET config 2 label) - - set(board "${vendor}${model}") - - # __