2020-04-07 16:35:02 +07:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2021-01-26 12:46:24 +07:00
|
|
|
# use BOARD-Directory name for project id
|
2021-01-23 18:09:57 +07:00
|
|
|
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
2021-01-26 12:46:24 +07:00
|
|
|
set(PROJECT ${BOARD}-${PROJECT})
|
2021-01-23 18:09:57 +07:00
|
|
|
|
2020-04-07 16:35:02 +07:00
|
|
|
# TOP is absolute path to root directory of TinyUSB git repo
|
|
|
|
set(TOP "../../..")
|
|
|
|
get_filename_component(TOP "${TOP}" REALPATH)
|
|
|
|
|
2021-01-23 18:09:57 +07:00
|
|
|
# Check for -DFAMILY=
|
2021-03-09 11:29:07 +01:00
|
|
|
if(FAMILY STREQUAL "esp32sx")
|
2021-01-26 12:46:24 +07:00
|
|
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
|
|
|
project(${PROJECT})
|
|
|
|
|
|
|
|
else()
|
2021-03-09 11:29:07 +01:00
|
|
|
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
2021-01-23 18:09:57 +07:00
|
|
|
endif()
|