Skip to content

Commit bae73f9

Browse files
authored
Merge pull request #10 from esp-idf-lib/fix_helper_cmake
chore: switch to eil-cmake-utils
2 parents b4f09df + 7249922 commit bae73f9

4 files changed

Lines changed: 17 additions & 18 deletions

File tree

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "common"]
2-
path = common
3-
url = https://github.com/esp-idf-lib/common.git
1+
[submodule "eil-cmake-utils"]
2+
path = eil-cmake-utils
3+
url = git@github.com:esp-idf-lib/eil-cmake-utils.git

CMakeLists.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# ESP-IDF CMake component for i2cdev library
2-
if(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} LESS 3)
3-
# Use driver component as esp_driver_gpio is not available before 5.3
4-
set(req driver freertos log esp_timer)
1+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/eil-cmake-utils/cmake)
2+
include(eil_check_idf_features)
3+
eil_check_idf_has_esp_drivers()
4+
5+
# List of common ESP-IDF components required by this component
6+
set(REQUIRED_COMPONENTS log freertos esp_idf_lib_helpers)
7+
8+
# Add version-specific required componenets
9+
if(EIL_IDF_HAS_ESP_DRIVERS)
10+
list(APPEND REQUIRED_COMPONENTS esp_driver_gpio esp_driver_i2c)
511
else()
6-
set(req esp_driver_gpio esp_driver_i2c freertos esp_idf_lib_helpers)
12+
list(APPEND REQUIRED_COMPONENTS driver)
713
endif()
814

915
# ESP-IDF version detection for automatic driver selection
@@ -38,13 +44,6 @@ endif()
3844
# Register the component
3945
idf_component_register(SRCS ${SRCS}
4046
INCLUDE_DIRS "."
41-
REQUIRES ${req})
42-
47+
REQUIRES ${REQUIRED_COMPONENTS})
4348

44-
# include common cmake file for components
45-
set(ESP_IDF_LIB_CMAKE ${CMAKE_CURRENT_LIST_DIR}/common/cmake/esp-idf-lib.cmake)
46-
if(EXISTS ${ESP_IDF_LIB_CMAKE})
47-
include(${ESP_IDF_LIB_CMAKE})
48-
else()
49-
message(WARNING "${ESP_IDF_LIB_CMAKE} not found")
50-
endif()
49+
include(eil_ci)

common

Lines changed: 0 additions & 1 deletion
This file was deleted.

eil-cmake-utils

Submodule eil-cmake-utils added at c91055e

0 commit comments

Comments
 (0)