-
Notifications
You must be signed in to change notification settings - Fork 1
/
picovision_import.cmake
31 lines (23 loc) · 1.13 KB
/
picovision_import.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 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_PICOVISION_PATH)
set(PIMORONI_PICOVISION_PATH "../../picovision/")
endif()
if(NOT IS_ABSOLUTE ${PIMORONI_PICOVISION_PATH})
get_filename_component(
PIMORONI_PICOVISION_PATH
"${CMAKE_CURRENT_BINARY_DIR}/${PIMORONI_PICOVISION_PATH}"
ABSOLUTE)
endif()
if (NOT EXISTS ${PIMORONI_PICOVISION_PATH})
message(FATAL_ERROR "Directory '${PIMORONI_PICOVISION_PATH}' not found")
endif ()
if (NOT EXISTS ${PIMORONI_PICOVISION_PATH}/picovision_import.cmake)
message(FATAL_ERROR "Directory '${PIMORONI_PICOVISION_PATH}' does not appear to contain the Picovision library")
endif ()
message("PIMORONI_PICOVISION_PATH is ${PIMORONI_PICOVISION_PATH}")
set(PIMORONI_PICOVISION_PATH ${PIMORONI_PICOVISION_PATH} CACHE PATH "Path to the Picovision libraries" FORCE)
include_directories(${PIMORONI_PICOVISION_PATH})
list(APPEND CMAKE_MODULE_PATH ${PIMORONI_PICOVISION_PATH})
include(picovision)
include_directories(${PIMORONI_PICO_PATH}/libraries/pico_graphics)