1CMAKE_MINIMUM_REQUIRED (VERSION 3.10.0)
2if (DEFINED MCUX_DEVICE AND NOT (DEFINED CONFIG_DEVICE))
3string (REGEX MATCH "^[A-Za-z0-9]+" CONFIG_DEVICE ${MCUX_DEVICE})
4string (REGEX REPLACE "${CONFIG_DEVICE}_" "" CONFIG_CORE ${MCUX_DEVICE})
5message("MCUX_DEVICE ${MCUX_DEVICE}")
6message("CONFIG_DEVICE ${CONFIG_DEVICE}")
7message("CONFIG_CORE ${CONFIG_CORE}")
8endif()
9
10list(APPEND CMAKE_MODULE_PATH
11    ${CMAKE_CURRENT_LIST_DIR}/devices/${CONFIG_DEVICE}
12)
13
14if (DEFINED MCUX_DEVICE)
15    include("all_lib_device_${MCUX_DEVICE}")
16elseif(EXISTS   ${CMAKE_CURRENT_LIST_DIR}/devices/${CONFIG_DEVICE}/all_lib_device.cmake)
17    include(all_lib_device)
18endif()
19