-
Notifications
You must be signed in to change notification settings - Fork 807
/
Copy pathCMakeLists.txt
35 lines (31 loc) · 1.11 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
if(CONFIG_BOARD_TARGET_PATH)
set(boards_dir ${CONFIG_BOARD_TARGET_PATH} )
else()
message(FATAL_ERROR, "Board path not exists")
endif()
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
list(APPEND PRIVREQ esp_adc)
else()
list(APPEND PRIVREQ esp_adc_cal)
endif()
set(user_src_dir "")
if(DEFINED boards_dir)
message(STATUS "-----------Board Info---------")
message(STATUS "IDF_TARGET = ${IDF_TARGET}")
message(STATUS "Board DIR = ${boards_dir}")
message(STATUS "---------Board Info End---------")
get_filename_component(abs_dir ${boards_dir} ABSOLUTE)
if(IS_DIRECTORY ${abs_dir})
file(GLOB dir_sources "${abs_dir}/*.c")
if(dir_sources)
set(user_src_dir ${abs_dir})
message(STATUS "source files found for '${boards_dir}'.")
else()
message(STATUS "No source files found for '${boards_dir}'.")
endif()
endif()
endif()
#The SRC_DIRS order cannot be changed, otherwise weak functions may not be overridden
idf_component_register( SRC_DIRS "${user_src_dir}" "."
INCLUDE_DIRS "${boards_dir}" "."
REQUIRES ${PRIVREQ} nvs_flash esp_wifi)