Skip to content

Commit

Permalink
Initial CMake files for pico-sdk (#174)
Browse files Browse the repository at this point in the history
* Add CMakeLists.txt that defines RF24Network as an INTERFACE library and works at least with the pico-sdk

* Change the CMake-mechanism to match what we have in the RF24 library

* Rename files so it might work with older versions of cmake as well
  • Loading branch information
kripton authored Jun 3, 2021
1 parent 0afb14d commit d8bcb22
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Check if we are building a pico-sdk based project
# (or more exactly: if we just got included in a pico-sdk based project)
if (PICO_SDK_PATH)
# If so, load the relevant CMakeLists-file but don't do anything else
include(${CMAKE_CURRENT_LIST_DIR}/usePicoSDK.cmake)
return()
endif()

## TODO: Non-PicoSDK builds
18 changes: 18 additions & 0 deletions usePicoSDK.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Include this file if you want to use the RF24Network library
## in YOUR (pico-sdk based) project.

cmake_minimum_required(VERSION 3.12)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Define the RF24Network library
add_library(RF24Network INTERFACE)

target_sources(RF24Network INTERFACE
${CMAKE_CURRENT_LIST_DIR}/RF24Network.cpp
)

target_include_directories(RF24Network INTERFACE
${CMAKE_CURRENT_LIST_DIR}/
)

0 comments on commit d8bcb22

Please sign in to comment.