-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
50 lines (42 loc) · 1.58 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
## ./targets/riscv/mikroe/common/CMakeLists.txt
if(${MCU_NAME} MATCHES "(^GD32VF103[CRTV](.+)6$)")
set(architecture "RISCV")
set(vendor "GIGADEVICE")
endif()
set(header_files "")
get_files(include/mcu_definitions/${vendor}/${MCU_NAME} header_files h)
mikrosdk_add_interface_library(lib_hal_ll_common MikroSDK.HalLowLevelCommon
include/hal_ll_bit_control.h
include/assembly.h
include/flatten_me.h
${header_files}
include/mcu_reg_addresses/${vendor}/${MCU_NAME}/mcu_reg_addresses.h
include/common_macros.h
include/common_types.h
)
target_compile_definitions(lib_hal_ll_common
INTERFACE
${architecture}
${vendor}
)
target_link_libraries(lib_hal_ll_common
INTERFACE
MikroC.Core
)
target_include_directories(lib_hal_ll_common
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mcu_definitions/${vendor}/${MCU_NAME}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mcu_reg_addresses/${vendor}/${MCU_NAME}>
$<INSTALL_INTERFACE:include>
)
mikrosdk_install(MikroSDK.HalLowLevelCommon)
install_headers(${CMAKE_INSTALL_PREFIX}/include/hal_ll_port MikroSDK.HalLowLevelCommon include/hal_ll_bit_control.h include/assembly.h include/flatten_me.h include/common_macros.h include/common_types.h)
string(TOLOWER ${MCU_NAME} MEMAKE_MCU_NAME_LOWER)
install(
FILES
${header_files}
include/mcu_reg_addresses/${vendor}/${MCU_NAME}/mcu_reg_addresses.h
DESTINATION
${CMAKE_INSTALL_PREFIX}/include/${MEMAKE_MCU_NAME_LOWER}
)