From 7d2eb285e60c08cce888ebd5b892a21b0511df43 Mon Sep 17 00:00:00 2001 From: Jacob Valdez Date: Fri, 3 Nov 2023 10:04:15 -0500 Subject: [PATCH 1/3] modernized make info --- CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++++++++++++++++ idf_component.yml | 8 ++++++++ 2 files changed, 56 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 idf_component.yml diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..56d47690 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,48 @@ +# Set a variable to represent the directory +set(c cpp_utils) + +idf_component_register( + # I might be missing the SRCS and PRIV_REQUIRES args + INCLUDE_DIRS "${c}" + REQUIRES nkolban # Adjust this to the actual requirements of your component. +) + +# Conditional source file compilation based on CONFIG_NKOLBAN +if(CONFIG_NKOLBAN) + target_sources(${COMPONENT_LIB} PRIVATE + "${c}/Task.cpp" + "${c}/FreeRTOS.cpp" + "${c}/GeneralUtils.cpp" + ) +endif() + +# Conditional source file compilation based on CONFIG_NKOLBAN_BLE +if(CONFIG_NKOLBAN_BLE) + target_sources(${COMPONENT_LIB} PRIVATE + "${c}/BLEAddress.cpp" + "${c}/BLEAdvertisedDevice.cpp" + "${c}/BLEAdvertising.cpp" + "${c}/BLECharacteristic.cpp" + "${c}/BLECharacteristicCallbacks.cpp" + "${c}/BLECharacteristicMap.cpp" + "${c}/BLEClient.cpp" + "${c}/BLEDescriptor.cpp" + "${c}/BLEDescriptorMap.cpp" + "${c}/BLEDevice.cpp" + "${c}/BLERemoteCharacteristic.cpp" + "${c}/BLERemoteDescriptor.cpp" + "${c}/BLERemoteService.cpp" + "${c}/BLEScan.cpp" + "${c}/BLEServer.cpp" + "${c}/BLEService.cpp" + "${c}/BLEServiceMap.cpp" + "${c}/BLEUUID.cpp" + "${c}/BLEUtils.cpp" + "${c}/BLEValue.cpp" + ) +endif() + +# Conditional source file compilation based on CONFIG_NKOLBAN_BLE2902 +if(CONFIG_NKOLBAN_BLE2902) + target_sources(${COMPONENT_LIB} PRIVATE "${c}/BLE2902.cpp") +endif() diff --git a/idf_component.yml b/idf_component.yml new file mode 100644 index 00000000..11635a51 --- /dev/null +++ b/idf_component.yml @@ -0,0 +1,8 @@ +name: "cpp_utils" +version: "1.0" +description: "A set of C++ utility classes for ESP-IDF." +tags: + - "utilities" + - "cpp" +dependencies: + # Dependencies here From 45a64ee1dfb4d14aae6bd99676f7d36084762d49 Mon Sep 17 00:00:00 2001 From: Jacob Valdez Date: Fri, 3 Nov 2023 11:15:57 -0500 Subject: [PATCH 2/3] fix? --- cpp_utils/CMakeLists.txt | 1 + idf_component.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp_utils/CMakeLists.txt b/cpp_utils/CMakeLists.txt index cb9b7267..24eb92d6 100644 --- a/cpp_utils/CMakeLists.txt +++ b/cpp_utils/CMakeLists.txt @@ -5,6 +5,7 @@ set(COMPONENT_REQUIRES "json" "mdns" "nvs_flash" + "bt" ) set(COMPONENT_PRIV_REQUIRES ) diff --git a/idf_component.yml b/idf_component.yml index 11635a51..43a1070d 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,8 +1,8 @@ name: "cpp_utils" -version: "1.0" +version: "1.0.0" description: "A set of C++ utility classes for ESP-IDF." tags: - "utilities" - "cpp" -dependencies: - # Dependencies here +dependencies: {} +# Dependencies here \ No newline at end of file From 23db78b6206c7bce0e833bc2f197d9ecf4cf0a2e Mon Sep 17 00:00:00 2001 From: Jacob Valdez Date: Fri, 3 Nov 2023 16:50:19 -0500 Subject: [PATCH 3/3] update --- .gitignore | 1 + CMakeLists.txt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 15d2ae94..20b6de2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .project .cproject .settings/ +/build # IDEs .vs/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 56d47690..c6c1645f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,11 @@ +cmake_minimum_required(VERSION 3.5) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + # Set a variable to represent the directory set(c cpp_utils) +# I might be missing the SRCS and PRIV_REQUIRES args idf_component_register( - # I might be missing the SRCS and PRIV_REQUIRES args INCLUDE_DIRS "${c}" REQUIRES nkolban # Adjust this to the actual requirements of your component. )