ArmDeveloperEcosystem / lorawan-library-for-pico

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡
BSD 3-Clause "New" or "Revised" License
125 stars 47 forks source link

Include the library in VSCode #11

Closed A4EVA closed 2 years ago

A4EVA commented 2 years ago

Hello, the project build perfectly on it's own but I would like to know how where should I copy the library in order to use it in other projects, I'm using Visual Studio Code on Windows 10.

Thank You

sandeepmistry commented 2 years ago

Hi @NitroProp,

I have not used this library with Visual Studio Code, but you can do the following to integrate the library with other projects.

Edit the CMakeLists.txt file of your project with:

1) Add a subdirectory line with a path to the library:

add_subdirectory("lib/lorawan-library-for-pico" EXCLUDE_FROM_ALL)

2) Add pico_lorawan inside the target_link_libraries line:

target_link_libraries(<your app name> pico_stdlib <other lib dependencies> pico_lorawan)

Then run cmake + make again for your project.