-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from pimoroni/patch-pimoroni-pico-import
Add an external import helper module
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file can be dropped into a project to help locate the Pimoroni Pico libraries | ||
# It will also set up the required include and module search paths. | ||
|
||
if (NOT PIMORONI_PICO_PATH) | ||
set(PIMORONI_PICO_PATH "../../pimoroni-pico/") | ||
endif() | ||
|
||
if(NOT IS_ABSOLUTE ${PIMORONI_PICO_PATH}) | ||
get_filename_component( | ||
PIMORONI_PICO_PATH | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PIMORONI_PICO_PATH}" | ||
ABSOLUTE) | ||
endif() | ||
|
||
if (NOT EXISTS ${PIMORONI_PICO_PATH}) | ||
message(FATAL_ERROR "Directory '${PIMORONI_PICO_PATH}' not found") | ||
endif () | ||
|
||
if (NOT EXISTS ${PIMORONI_PICO_PATH}/pimoroni_pico_import.cmake) | ||
message(FATAL_ERROR "Directory '${PIMORONI_PICO_PATH}' does not appear to contain the Pimoroni Pico libraries") | ||
endif () | ||
|
||
message("PIMORONI_PICO_PATH is ${PIMORONI_PICO_PATH}") | ||
|
||
set(PIMORONI_PICO_PATH ${PIMORONI_PICO_PATH} CACHE PATH "Path to the Pimoroni Pico libraries" FORCE) | ||
|
||
include_directories(${PIMORONI_PICO_PATH}) | ||
list(APPEND CMAKE_MODULE_PATH ${PIMORONI_PICO_PATH}) |