From 90efda9309b140a500c66bfccbc79e2c44eaafab Mon Sep 17 00:00:00 2001 From: VietDzung Date: Sat, 26 Oct 2024 23:19:48 +0700 Subject: [PATCH] Support use as ESP IDF component --- CMakeLists.txt | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af5b0ec..b853f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,19 @@ -cmake_policy(SET CMP0048 NEW) -cmake_minimum_required(VERSION 3.16) -project(knx VERSION 1.5) - - -add_subdirectory(examples/knx-linux) -add_subdirectory(examples/knx-linux-coupler) -add_subdirectory(examples/knxPython) +set(COMPONENT_SRCDIRS +"src" +"src/knx" +) + +set(COMPONENT_ADD_INCLUDEDIRS +"src" +"src/knx" +) + +set(COMPONENT_REQUIRES +"arduino-esp32" +"libsodium" +) + +register_component() + +target_compile_definitions(${COMPONENT_TARGET} PUBLIC -DESP32) +target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti) \ No newline at end of file