diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e2be1a85c..fce86072c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,12 @@ if(NOT KCONFIGLIB) $ pip install kconfiglib") endif() -if(EXISTS ${BOARD_CONFIG} AND EXISTS ${BOARD_CONFIG}/defconfig) +# BOARD CONFIG can be set to directory path, or [/:] +# configuration pair + +if((EXISTS ${BOARD_CONFIG} AND EXISTS ${BOARD_CONFIG}/defconfig) + OR (EXISTS ${NUTTX_DIR}/${BOARD_CONFIG} + AND EXISTS ${NUTTX_DIR}/${BOARD_CONFIG}/defconfig)) get_filename_component(NUTTX_BOARD_ABS_DIR ${BOARD_CONFIG} ABSOLUTE BASE_DIR ${NUTTX_DIR}) @@ -103,7 +108,7 @@ if(EXISTS ${BOARD_CONFIG} AND EXISTS ${BOARD_CONFIG}/defconfig) string(REGEX REPLACE "(.*)/(.*)/${NUTTX_CONFIG}" "\\1" NUTTX_BOARD_DIR ${NUTTX_BOARD_ABS_DIR}) - set(NUTTX_DEFCONFIG ${BOARD_CONFIG}/defconfig) + set(NUTTX_DEFCONFIG ${NUTTX_BOARD_ABS_DIR}/defconfig) else() if(BOARD_CONFIG MATCHES "/") set(MATCH_REGEX "/")