2020-04-07 13:42:48 +07:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2021-01-23 00:59:50 +07:00
|
|
|
# use directory name for project id
|
|
|
|
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
|
|
|
2020-04-07 13:42:48 +07:00
|
|
|
# TOP is absolute path to root directory of TinyUSB git repo
|
|
|
|
set(TOP "../../..")
|
|
|
|
get_filename_component(TOP "${TOP}" REALPATH)
|
|
|
|
|
2021-01-22 14:58:32 +07:00
|
|
|
# Check for -DFAMILY=
|
2021-01-24 00:12:20 +07:00
|
|
|
if(FAMILY STREQUAL "esp32s2")
|
|
|
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
|
|
|
project(${PROJECT})
|
2021-01-23 00:12:10 +07:00
|
|
|
|
2021-01-24 00:12:20 +07:00
|
|
|
elseif(FAMILY STREQUAL "rp2040")
|
|
|
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
2021-01-23 00:12:10 +07:00
|
|
|
|
2021-01-24 00:12:20 +07:00
|
|
|
# Example source
|
|
|
|
target_sources(${PROJECT} PUBLIC
|
|
|
|
src/main.c
|
|
|
|
)
|
2021-01-23 00:59:50 +07:00
|
|
|
|
2021-01-24 00:12:20 +07:00
|
|
|
# Example include
|
|
|
|
target_include_directories(${PROJECT} PUBLIC
|
|
|
|
src
|
|
|
|
)
|
2021-01-23 00:12:10 +07:00
|
|
|
|
2021-01-24 00:12:20 +07:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Invalid FAMILY specified")
|
2021-01-23 00:12:10 +07:00
|
|
|
endif()
|