-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (39 loc) · 1.24 KB
/
CMakeLists.txt
File metadata and controls
48 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.18) #FetchContent
# Only supported for target cross-compiled build
if ( NOT CMAKE_CROSSCOMPILING )
return()
endif()
# --------
# Options
# --------
# Note: 0.9.0 doens't work with the current TinyUSB due to define of USB_0_IRQn changed?
set( TinyUsbVersion "0.14.0" CACHE STRING "TinyUSB library version")
set_property(CACHE TinyUsbVersion PROPERTY STRINGS
0.14.0
0.13.0
0.12.0
0.10.1
0.10.0
0.9.0
0.8.0
)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include(CPM)
CPMAddPackage(
NAME tinyusb
GITHUB_REPOSITORY hathach/tinyusb
GIT_TAG ${TinyUsbVersion}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
GIT_SUBMODULES "hw/mcu/microchip"
DOWNLOAD_ONLY YES
)
if(tinyusb_ADDED)
# Inject and use tinyusb.cmake
write_file( ${tinyusb_SOURCE_DIR}/CMakeLists.txt "include(${CMAKE_CURRENT_LIST_DIR}/tinyusb.cmake)" )
file(STRINGS ${tinyusb_SOURCE_DIR}/.git/info/exclude excludes)
if (NOT "/CMakeLists.txt" IN_LIST excludes) # Add git local exclusion for the generated file
file( APPEND ${tinyusb_SOURCE_DIR}/.git/info/exclude "/CMakeLists.txt\n")
endif()
add_subdirectory(${tinyusb_SOURCE_DIR} ${tinyusb_BINARY_DIR})
endif()