]> git.scottworley.com Git - tattlekey/blob - client/pico_sdk_import.cmake
README: Image path for display in gitweb
[tattlekey] / client / pico_sdk_import.cmake
1 # This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake
2
3 # This can be dropped into an external project to help locate this SDK
4 # It should be include()ed prior to project()
5
6 if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
7 set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
8 message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
9 endif ()
10
11 set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK")
12
13 if (NOT PICO_SDK_PATH)
14 message(FATAL_ERROR "SDK location was not specified. Please set PICO_SDK_PATH.")
15 endif ()
16
17 get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
18 if (NOT EXISTS ${PICO_SDK_PATH})
19 message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found")
20 endif ()
21
22 set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake)
23 if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE})
24 message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK")
25 endif ()
26
27 set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE)
28
29 include(${PICO_SDK_INIT_CMAKE_FILE})