diff --git a/CMakeLists.txt b/CMakeLists.txt index e4c5dd31..c995fcbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,16 @@ cmake_minimum_required(VERSION 3.5) -project(u8g2) set(COMPONENT_ADD_INCLUDEDIRS csrc) file(GLOB COMPONENT_SRCS csrc/*.c) file(GLOB COMPONENT_HDRS csrc/*.h) +if(COMMAND idf_component_register) + idf_component_register(SRCS "${COMPONENT_SRCS}" INCLUDE_DIRS csrc) + return() +endif() + +project(u8g2) + if(COMMAND register_component) set(COMPONENT_NAME ".") register_component()