-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
66 lines (53 loc) · 1.96 KB
/
CMakeLists.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## ./targets/pic_32bit/mikroe/pic32/src/dma/CMakeLists.txt
set(hal_ll_def_list "")
## BEGIN DMA
if(${MCU_NAME} MATCHES "PIC32")
string(SUBSTRING ${MCU_NAME} 0 5 MCU_NAME_FIRST_5)
string(SUBSTRING ${MCU_NAME} 0 7 MCU_NAME_FIRST_7)
string(SUBSTRING ${MCU_NAME} 0 8 MCU_NAME_FIRST_8)
string(SUBSTRING ${MCU_NAME} 0 10 MCU_NAME_FIRST_10)
list(APPEND hal_ll_def_list ${MCU_NAME})
list(APPEND hal_ll_def_list ${MCU_NAME_FIRST_5}xx)
list(APPEND hal_ll_def_list ${MCU_NAME_FIRST_7}xx)
list(APPEND hal_ll_def_list ${MCU_NAME_FIRST_8}xx)
list(APPEND hal_ll_def_list ${MCU_NAME_FIRST_10}xx)
if (NOT (${MCU_NAME} MATCHES "^PIC32MX(3|4)(2|4|6)0.+"))
list(APPEND hal_ll_def_list HAL_LL_DMA_DCHCON_CHBUSY_AVAILABLE)
endif()
list(APPEND hal_ll_def_list "__pic32__")
else()
list(APPEND hal_ll_def_list "__family_not_supported__")
endif()
if(${MCU_NAME} MATCHES "(^PIC32.*$)")
set(dma_implementation "implementation_1/hal_ll_dma.c")
endif()
mikrosdk_add_library(lib_hal_ll_dma MikroSDK.HalLowLevel.DMA
${dma_implementation}
../../include/hal_ll_target.h
## BEGIN DMA
../../include/dma/hal_ll_dma.h
## END DMA
)
target_compile_definitions(lib_hal_ll_dma PUBLIC
${hal_ll_def_list}
)
target_link_libraries(lib_hal_ll_dma PUBLIC
MikroC.Core
MikroSDK.HalLowLevelCore
MikroSDK.HalLowLevelCommon
)
string(TOLOWER ${MCU_NAME} MCU_HEADER_PATH_LOWER)
target_include_directories(lib_hal_ll_dma
PRIVATE
../../include
## BEGIN DMA
../../include/dma
## END DMA
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include/dma>
$<INSTALL_INTERFACE:include/hal_ll_port>
$<INSTALL_INTERFACE:include/${MCU_HEADER_PATH_LOWER}>
)
mikrosdk_install(MikroSDK.HalLowLevel.DMA)
install_headers(${CMAKE_INSTALL_PREFIX}/include/hal_ll_port MikroSDK.HalLowLevel.DMA ../../include/dma/hal_ll_dma.h)