2021-08-04 12:09:21 -03:00
|
|
|
set(BOARD_DEFCONFIG ${PX4_CONFIG_FILE} CACHE FILEPATH "path to defconfig" FORCE)
|
2021-03-12 10:50:25 -04:00
|
|
|
set(BOARD_CONFIG ${PX4_BINARY_DIR}/boardconfig CACHE FILEPATH "path to config" FORCE)
|
2021-03-11 18:03:45 -04:00
|
|
|
|
|
|
|
find_program(MENUCONFIG_PATH menuconfig)
|
|
|
|
find_program(GUICONFIG_PATH guiconfig)
|
2021-03-12 10:50:25 -04:00
|
|
|
find_program(DEFCONFIG_PATH defconfig)
|
|
|
|
find_program(SAVEDEFCONFIG_PATH savedefconfig)
|
|
|
|
if(NOT MENUCONFIG_PATH OR NOT GUICONFIG_PATH OR NOT DEFCONFIG_PATH OR NOT SAVEDEFCONFIG_PATH)
|
2021-03-11 18:24:48 -04:00
|
|
|
message(STATUS "kconfiglib is not installed\n"
|
2021-03-11 18:03:45 -04:00
|
|
|
"please install using \"pip3 install kconfiglib\"\n")
|
|
|
|
endif()
|
|
|
|
|
2021-08-04 12:09:21 -03:00
|
|
|
|
2021-03-11 14:39:01 -04:00
|
|
|
set(COMMON_KCONFIG_ENV_SETTINGS
|
|
|
|
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
2021-03-12 10:50:25 -04:00
|
|
|
KCONFIG_CONFIG=${BOARD_CONFIG}
|
2021-03-11 14:39:01 -04:00
|
|
|
# Set environment variables so that Kconfig can prune Kconfig source
|
|
|
|
# files for other architectures
|
|
|
|
PLATFORM=${PX4_PLATFORM}
|
|
|
|
VENDOR=${PX4_BOARD_VENDOR}
|
|
|
|
MODEL=${PX4_BOARD_MODEL}
|
|
|
|
LABEL=${PX4_BOARD_LABEL}
|
|
|
|
TOOLCHAIN=${CMAKE_TOOLCHAIN_FILE}
|
|
|
|
ARCHITECTURE=${CMAKE_SYSTEM_PROCESSOR}
|
|
|
|
ROMFSROOT=${config_romfs_root}
|
|
|
|
)
|
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
if(EXISTS ${BOARD_DEFCONFIG})
|
2021-03-12 10:50:25 -04:00
|
|
|
|
2021-08-03 14:12:46 -03:00
|
|
|
# Depend on BOARD_DEFCONFIG so that we reconfigure on config change
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${BOARD_DEFCONFIG})
|
2021-03-12 10:50:25 -04:00
|
|
|
|
2021-08-17 13:46:37 -03:00
|
|
|
if(${LABEL} MATCHES "default" OR ${LABEL} MATCHES "bootloader" OR ${LABEL} MATCHES "canbootloader")
|
2021-08-17 13:41:59 -03:00
|
|
|
# Generate boardconfig from saved defconfig
|
2021-08-05 09:33:27 -03:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS}
|
2021-08-17 13:41:59 -03:00
|
|
|
${DEFCONFIG_PATH} ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE DUMMY_RESULTS)
|
|
|
|
else()
|
2021-08-17 13:41:59 -03:00
|
|
|
# Generate boardconfig from default.px4board and {label}.px4board
|
2021-08-05 09:33:27 -03:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS}
|
2021-08-17 13:41:59 -03:00
|
|
|
${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/kconfig/merge_config.py Kconfig ${BOARD_CONFIG} ${PX4_BOARD_DIR}/default.px4board ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE DUMMY_RESULTS)
|
|
|
|
endif()
|
2021-03-12 10:50:25 -04:00
|
|
|
|
2021-08-03 14:12:46 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
# parse board config options for cmake
|
2021-03-12 10:50:25 -04:00
|
|
|
file(STRINGS ${BOARD_CONFIG} ConfigContents)
|
2021-03-11 18:24:48 -04:00
|
|
|
foreach(NameAndValue ${ConfigContents})
|
|
|
|
# Strip leading spaces
|
|
|
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
|
|
|
|
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG[^=]+" Name ${NameAndValue})
|
|
|
|
|
|
|
|
if(Name)
|
|
|
|
# Find the value
|
|
|
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
|
|
|
|
|
|
|
if(Value)
|
|
|
|
# remove extra quotes
|
|
|
|
string(REPLACE "\"" "" Value ${Value})
|
|
|
|
|
|
|
|
# Set the variable
|
|
|
|
set(${Name} ${Value} CACHE INTERNAL "BOARD DEFCONFIG: ${Name}" FORCE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-08-04 09:58:31 -03:00
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG_BOARD_" Board ${NameAndValue})
|
|
|
|
|
|
|
|
if(Board)
|
|
|
|
string(REPLACE "CONFIG_BOARD_" "" ConfigKey ${Name})
|
|
|
|
if(Value)
|
|
|
|
set(${ConfigKey} ${Value})
|
|
|
|
message(STATUS "${ConfigKey} ${Value}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG_DRIVERS[^=]+" Drivers ${NameAndValue})
|
|
|
|
|
|
|
|
if(Drivers)
|
|
|
|
# Find the value
|
|
|
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
|
|
|
string(REPLACE "CONFIG_DRIVERS_" "" driver ${Name})
|
|
|
|
string(TOLOWER ${driver} driver)
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
string(REPLACE "_" "/" driver_path ${driver})
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
# Pattern 1 XXX / XXX_XXX
|
2021-08-18 04:45:58 -03:00
|
|
|
string(REGEX REPLACE "(^[a-z]+)_([a-z0-9]+_[a-z0-9]+).*$" "\\1" driver_p1_folder ${driver})
|
|
|
|
string(REGEX REPLACE "(^[a-z]+)_([a-z0-9]+_[a-z0-9]+).*$" "\\2" driver_p1_subfolder ${driver})
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
# Pattern 2 XXX_XXX / XXXXXX
|
2021-08-18 04:45:58 -03:00
|
|
|
string(REGEX REPLACE "(^[a-z]+_[a-z0-9]+)_([a-z0-9]+).*$" "\\1" driver_p2_folder ${driver})
|
|
|
|
string(REGEX REPLACE "(^[a-z]+_[a-z0-9]+)_([a-z0-9]+).*$" "\\2" driver_p2_subfolder ${driver})
|
2021-03-11 18:24:48 -04:00
|
|
|
|
2021-08-05 05:05:52 -03:00
|
|
|
# Pattern 3 XXXXXX / XXX_XXX / XXXXXX
|
2021-08-18 04:45:58 -03:00
|
|
|
string(REGEX REPLACE "(^[a-z]+)_([a-z0-9]+_[a-z0-9]+)_([a-z]+[a-z0-9]+).*$" "\\1" driver_p3_folder ${driver})
|
|
|
|
string(REGEX REPLACE "(^[a-z]+)_([a-z0-9]+_[a-z0-9]+)_([a-z]+[a-z0-9]+).*$" "\\2" driver_p3_subfolder ${driver})
|
|
|
|
string(REGEX REPLACE "(^[a-z]+)_([a-z0-9]+_[a-z0-9]+)_([a-z]+[a-z0-9]+).*$" "\\3" driver_p3_subsubfolder ${driver})
|
2021-08-05 05:05:52 -03:00
|
|
|
|
2021-08-18 11:49:25 -03:00
|
|
|
# Pattern 4 XXX_XXX / XXX_XXX_XXX
|
|
|
|
string(REGEX REPLACE "(^[a-z]+_[a-z0-9]+)_([a-z_0-9]+).*$" "\\1" driver_p4_folder ${driver})
|
|
|
|
string(REGEX REPLACE "(^[a-z]+_[a-z0-9]+)_([a-z_0-9]+).*$" "\\2" driver_p4_subfolder ${driver})
|
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
# Trick circumvent PX4 src naming problem with underscores and slashes
|
|
|
|
if(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver})
|
|
|
|
list(APPEND config_module_list drivers/${driver})
|
|
|
|
elseif(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver_path})
|
|
|
|
list(APPEND config_module_list drivers/${driver_path})
|
2021-08-05 05:05:52 -03:00
|
|
|
elseif(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver_p3_folder}/${driver_p3_subfolder}/${driver_p3_subsubfolder})
|
|
|
|
list(APPEND config_module_list drivers/${driver_p3_folder}/${driver_p3_subfolder}/${driver_p3_subsubfolder})
|
2021-03-11 18:24:48 -04:00
|
|
|
elseif(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver_p1_folder}/${driver_p1_subfolder})
|
|
|
|
list(APPEND config_module_list drivers/${driver_p1_folder}/${driver_p1_subfolder})
|
2021-08-18 11:49:25 -03:00
|
|
|
elseif(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver_p4_folder}/${driver_p4_subfolder})
|
|
|
|
list(APPEND config_module_list drivers/${driver_p4_folder}/${driver_p4_subfolder})
|
2021-08-18 12:20:24 -03:00
|
|
|
elseif(EXISTS ${PX4_SOURCE_DIR}/src/drivers/${driver_p2_folder}/${driver_p2_subfolder})
|
|
|
|
list(APPEND config_module_list drivers/${driver_p2_folder}/${driver_p2_subfolder})
|
2021-03-11 18:24:48 -04:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Couldn't find path for ${driver}")
|
|
|
|
endif()
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG_MODULES[^=]+" Modules ${NameAndValue})
|
|
|
|
|
|
|
|
if(Modules)
|
|
|
|
# Find the value
|
|
|
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
|
|
|
string(REPLACE "CONFIG_MODULES_" "" module ${Name})
|
|
|
|
string(TOLOWER ${module} module)
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
list(APPEND config_module_list modules/${module})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG_SYSTEMCMDS[^=]+" Systemcmds ${NameAndValue})
|
|
|
|
|
|
|
|
if(Systemcmds)
|
|
|
|
# Find the value
|
|
|
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
|
|
|
string(REPLACE "CONFIG_SYSTEMCMDS_" "" systemcmd ${Name})
|
|
|
|
string(TOLOWER ${systemcmd} systemcmd)
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
list(APPEND config_module_list systemcmds/${systemcmd})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Find variable name
|
|
|
|
string(REGEX MATCH "^CONFIG_EXAMPLES[^=]+" Examples ${NameAndValue})
|
|
|
|
|
|
|
|
if(Examples)
|
|
|
|
# Find the value
|
|
|
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
|
|
|
string(REPLACE "CONFIG_EXAMPLES_" "" example ${Name})
|
|
|
|
string(TOLOWER ${example} example)
|
2021-08-04 09:58:31 -03:00
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
list(APPEND config_module_list examples/${example})
|
|
|
|
endif()
|
2021-03-12 15:53:19 -04:00
|
|
|
|
2021-08-04 09:58:31 -03:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(PLATFORM)
|
|
|
|
# set OS, and append specific platform module path
|
|
|
|
set(PX4_PLATFORM ${PLATFORM} CACHE STRING "PX4 board OS" FORCE)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake)
|
|
|
|
|
|
|
|
# platform-specific include path
|
|
|
|
include_directories(${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ARCHITECTURE)
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE INTERNAL "system processor" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TOOLCHAIN)
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE Toolchain-${TOOLCHAIN} CACHE INTERNAL "toolchain file" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(romfs_extra_files)
|
|
|
|
set(config_romfs_extra_dependencies)
|
|
|
|
# additional embedded metadata
|
|
|
|
if (NOT CONSTRAINED_FLASH AND NOT EXTERNAL_METADATA AND NOT ${PX4_BOARD_LABEL} STREQUAL "test")
|
|
|
|
list(APPEND romfs_extra_files
|
|
|
|
${PX4_BINARY_DIR}/parameters.json.xz
|
|
|
|
${PX4_BINARY_DIR}/events/all_events.json.xz)
|
|
|
|
list(APPEND romfs_extra_dependencies
|
|
|
|
parameters_xml
|
|
|
|
events_json)
|
|
|
|
endif()
|
|
|
|
list(APPEND romfs_extra_files ${PX4_BINARY_DIR}/component_general.json.xz)
|
|
|
|
list(APPEND romfs_extra_dependencies component_general_json)
|
|
|
|
set(config_romfs_extra_files ${romfs_extra_files} CACHE INTERNAL "extra ROMFS files" FORCE)
|
|
|
|
set(config_romfs_extra_dependencies ${romfs_extra_dependencies} CACHE INTERNAL "extra ROMFS deps" FORCE)
|
|
|
|
|
|
|
|
if(SERIAL_PORTS)
|
|
|
|
set(board_serial_ports ${SERIAL_PORTS} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Serial ports
|
|
|
|
set(board_serial_ports)
|
|
|
|
if(SERIAL_GPS1)
|
|
|
|
list(APPEND board_serial_ports GPS1:${SERIAL_GPS1})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_GPS2)
|
|
|
|
list(APPEND board_serial_ports GPS2:${SERIAL_GPS2})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_GPS3)
|
|
|
|
list(APPEND board_serial_ports GPS3:${SERIAL_GPS3})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_GPS4)
|
|
|
|
list(APPEND board_serial_ports GPS4:${SERIAL_GPS4})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_GPS5)
|
|
|
|
list(APPEND board_serial_ports GPS5:${SERIAL_GPS5})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_TEL1)
|
|
|
|
list(APPEND board_serial_ports TEL1:${SERIAL_TEL1})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_TEL2)
|
|
|
|
list(APPEND board_serial_ports TEL2:${SERIAL_TEL2})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_TEL3)
|
|
|
|
list(APPEND board_serial_ports TEL3:${SERIAL_TEL3})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_TEL4)
|
|
|
|
list(APPEND board_serial_ports TEL4:${SERIAL_TEL4})
|
|
|
|
endif()
|
|
|
|
if(SERIAL_TEL5)
|
|
|
|
list(APPEND board_serial_ports TEL5:${SERIAL_TEL5})
|
|
|
|
endif()
|
2021-03-12 15:53:19 -04:00
|
|
|
|
|
|
|
|
2021-08-04 09:58:31 -03:00
|
|
|
# ROMFS
|
|
|
|
if(ROMFSROOT)
|
|
|
|
set(config_romfs_root ${ROMFSROOT} CACHE INTERNAL "ROMFS root" FORCE)
|
|
|
|
|
|
|
|
if(BUILD_BOOTLOADER)
|
|
|
|
set(config_build_bootloader "1" CACHE INTERNAL "build bootloader" FORCE)
|
2021-03-12 15:53:19 -04:00
|
|
|
endif()
|
|
|
|
|
2021-08-04 09:58:31 -03:00
|
|
|
# IO board (placed in ROMFS)
|
|
|
|
if(IO)
|
|
|
|
set(config_io_board ${IO} CACHE INTERNAL "IO" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UAVCAN_PERIPHERALS)
|
|
|
|
set(config_uavcan_peripheral_firmware ${UAVCAN_PERIPHERALS} CACHE INTERNAL "UAVCAN peripheral firmware" FORCE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UAVCAN_INTERFACES)
|
|
|
|
set(config_uavcan_num_ifaces ${UAVCAN_INTERFACES} CACHE INTERNAL "UAVCAN interfaces" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UAVCAN_TIMER_OVERRIDE)
|
|
|
|
set(config_uavcan_timer_override ${UAVCAN_TIMER_OVERRIDE} CACHE INTERNAL "UAVCAN TIMER OVERRIDE" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
|
|
|
if(CONSTRAINED_FLASH)
|
|
|
|
set(px4_constrained_flash_build "1" CACHE INTERNAL "constrained flash build" FORCE)
|
|
|
|
add_definitions(-DCONSTRAINED_FLASH)
|
|
|
|
if (NO_HELP)
|
|
|
|
add_definitions(-DCONSTRAINED_FLASH_NO_HELP="https://docs.px4.io/master/en/modules/modules_main.html")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONSTRAINED_MEMORY)
|
|
|
|
set(px4_constrained_memory_build "1" CACHE INTERNAL "constrained memory build" FORCE)
|
|
|
|
add_definitions(-DCONSTRAINED_MEMORY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TESTING)
|
|
|
|
set(PX4_TESTING "1" CACHE INTERNAL "testing enabled" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ETHERNET)
|
|
|
|
set(PX4_ETHERNET "1" CACHE INTERNAL "ethernet enabled" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CRYPTO)
|
|
|
|
set(PX4_CRYPTO ${CRYPTO} CACHE STRING "PX4 crypto implementation" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(KEYSTORE)
|
|
|
|
set(PX4_KEYSTORE ${KEYSTORE} CACHE STRING "PX4 keystore implementation" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LINKER_PREFIX)
|
|
|
|
set(PX4_BOARD_LINKER_PREFIX ${LINKER_PREFIX} CACHE STRING "PX4 board linker prefix" FORCE)
|
|
|
|
else()
|
|
|
|
set(PX4_BOARD_LINKER_PREFIX "" CACHE STRING "PX4 board linker prefix" FORCE)
|
|
|
|
endif()
|
|
|
|
|
2021-08-11 16:07:46 -03:00
|
|
|
if(COMPILE_DEFINITIONS)
|
|
|
|
add_definitions( ${COMPILE_DEFINITIONS})
|
|
|
|
endif()
|
|
|
|
|
2021-08-18 04:45:58 -03:00
|
|
|
if(LINUX)
|
|
|
|
add_definitions( "-D__PX4_LINUX" )
|
|
|
|
endif()
|
|
|
|
|
2021-08-18 10:12:37 -03:00
|
|
|
if(LOCKSTEP)
|
|
|
|
set(ENABLE_LOCKSTEP_SCHEDULER yes)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOLOCKSTEP)
|
|
|
|
set(ENABLE_LOCKSTEP_SCHEDULER no)
|
|
|
|
endif()
|
|
|
|
|
2021-08-04 09:58:31 -03:00
|
|
|
include(px4_impl_os)
|
|
|
|
px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD})
|
|
|
|
|
|
|
|
# add board config directory src to build modules
|
|
|
|
file(RELATIVE_PATH board_support_src_rel ${PX4_SOURCE_DIR}/src ${PX4_BOARD_DIR})
|
|
|
|
list(APPEND config_module_list ${board_support_src_rel}/src)
|
|
|
|
|
|
|
|
set(config_module_list ${config_module_list})
|
|
|
|
|
2021-03-11 18:24:48 -04:00
|
|
|
endif()
|
2021-08-04 12:09:21 -03:00
|
|
|
|
|
|
|
|
2021-08-17 13:46:37 -03:00
|
|
|
if(${LABEL} MATCHES "default" OR ${LABEL} MATCHES "bootloader" OR ${LABEL} MATCHES "canbootloader")
|
2021-08-05 09:33:27 -03:00
|
|
|
add_custom_target(boardconfig
|
|
|
|
${CMAKE_COMMAND} -E env
|
|
|
|
${COMMON_KCONFIG_ENV_SETTINGS}
|
|
|
|
${MENUCONFIG_PATH} Kconfig
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH}
|
2021-08-17 13:41:59 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy defconfig ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rm ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp
|
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
COMMAND_EXPAND_LISTS
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(boardguiconfig
|
|
|
|
${CMAKE_COMMAND} -E env
|
|
|
|
${COMMON_KCONFIG_ENV_SETTINGS}
|
|
|
|
${GUICONFIG_PATH} Kconfig
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH}
|
2021-08-17 13:41:59 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy defconfig ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rm ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp
|
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
COMMAND_EXPAND_LISTS
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_custom_target(boardconfig
|
|
|
|
${CMAKE_COMMAND} -E env
|
|
|
|
${COMMON_KCONFIG_ENV_SETTINGS}
|
|
|
|
${MENUCONFIG_PATH} Kconfig
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH}
|
2021-08-17 13:41:59 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/kconfig/diffconfig.py -m ${PX4_BOARD_DIR}/default.px4board defconfig > ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rm ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp
|
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
COMMAND_EXPAND_LISTS
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(boardguiconfig
|
|
|
|
${CMAKE_COMMAND} -E env
|
|
|
|
${COMMON_KCONFIG_ENV_SETTINGS}
|
|
|
|
${GUICONFIG_PATH} Kconfig
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH}
|
2021-08-17 13:41:59 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/kconfig/diffconfig.py -m ${PX4_BOARD_DIR}/default.px4board defconfig > ${BOARD_DEFCONFIG}
|
2021-08-05 09:33:27 -03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rm ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp
|
|
|
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
COMMAND_EXPAND_LISTS
|
|
|
|
)
|
|
|
|
endif()
|