Updated CMake for ESP-IDF (#748)
This commit is contained in:
parent
8e6bd972a9
commit
9f5e77616b
1 changed files with 20 additions and 1 deletions
|
@ -1,5 +1,25 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
if(ESP_PLATFORM)
|
||||
# Build RadioLib as an ESP-IDF component
|
||||
# required because ESP-IDF runs cmake in script mode
|
||||
# and needs idf_component_register()
|
||||
file(GLOB_RECURSE RADIOLIB_ESP_SOURCES
|
||||
"src/*.*"
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${RADIOLIB_ESP_SOURCES}
|
||||
INCLUDE_DIRS . src
|
||||
)
|
||||
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SCRIPT_MODE_FILE)
|
||||
message(FATAL_ERROR "Attempted to build RadioLib in script mode")
|
||||
endif()
|
||||
|
||||
project(radiolib)
|
||||
|
||||
file(GLOB_RECURSE RADIOLIB_SOURCES
|
||||
|
@ -23,4 +43,3 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/
|
|||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RadioLib
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue