-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
50 lines (41 loc) · 1.61 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/gigadevice/src/i2c/CMakeLists.txt
set(hal_ll_def_list "")
set(mcu_header_path "")
list(APPEND hal_ll_def_list ${MCU_NAME})
## BEGIN I2C
set(mcu_header_path ${MCU_NAME})
set(i2c_subimplementation "implementation_1/hal_ll_i2c_master.c")
set(i2c_pin_map "hal_ll_i2c_pin_map/implementation_1")
# END I2C
mikrosdk_add_library(lib_hal_ll_i2c_master MikroSDK.HalLowLevel.I2C.Master
${i2c_subimplementation}
../../include/hal_ll_rcu.h
../../include/hal_ll_target.h
../../include/i2c/hal_ll_i2c_master.h
../../include/i2c/${i2c_pin_map}/hal_ll_i2c_pin_map.h
)
target_compile_definitions(lib_hal_ll_i2c_master PUBLIC
${hal_ll_def_list}
)
target_link_libraries(lib_hal_ll_i2c_master PUBLIC
MikroC.Core
MikroSDK.HalLowLevelCore
MikroSDK.HalLowLevelCommon
)
string(TOLOWER ${mcu_header_path} MCU_HEADER_PATH_LOWER)
target_include_directories(lib_hal_ll_i2c_master
PRIVATE
../../include
../../include/gpio
../../include/i2c
../../include/i2c/${i2c_pin_map}
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include/gpio>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include/i2c>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include/i2c/${i2c_pin_map}>
$<INSTALL_INTERFACE:include/hal_ll_port>
$<INSTALL_INTERFACE:include/${MCU_HEADER_PATH_LOWER}>
)
mikrosdk_install(MikroSDK.HalLowLevel.I2C.Master)
install_headers(${CMAKE_INSTALL_PREFIX}/include/hal_ll_port MikroSDK.HalLowLevel.I2C.Master ../../include/i2c/hal_ll_i2c_master.h)