Skip to content

User libraries easy declaration #12

Description

@rei-vilo

SKETCHBOOK_PATH is declared on the Project > Build Settings pane under the User-Defined list:

SKETCHBOOK_PATH = ~/Documents/Arduino/_Projets

Yes, the ~ works!

If the sketch includes

#include "NewSoftSerial.h"
#include "Serial_LCD"

Makefile:

# Declare paths of included user libraries, even if a folder contains multiple .cpp files
# Serial_LCD contains proxySerial, Serial_LCD, GUI, Graphics .h and .cpp files
USR_LIBRARIES_LIST  = NewSoftSerial Serial_LCD

# find .cpp files for user's libraries in sketchbook/libraries folder
USR_LIBRARIES_PATH = $(foreach lib, $(USR_LIBRARIES_LIST), $(wildcard $(SKETCHBOOK_PATH)/Libraries/$(lib)))
USR_LIBRARIES      = $(foreach lib, $(USR_LIBRARIES_LIST), $(wildcard $(SKETCHBOOK_PATH)/Libraries/$(lib)/*.cpp))
CPP_LIBRARIES     += $(USR_LIBRARIES)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions