I am attempting to develop against the raspberry pi pico SDK in conjunction with CPM within vscode. This SDK comes with toolchains files and sets the CMAKE_TOOLCHAIN_FILE variable during part of its bootup. My simplified CMakeLists.txt looks like:
cmake_minimum_required(VERSION 3.25)
project(MyProject C CXX ASM)
# set up CPM - you may have to create the below directory
set(CPM_SOURCE_CACHE "/tmp/.cache")
include(cmake/get_cpm.cmake)
# download the sdk
CPMAddPackage(
NAME pico-sdk
GITHUB_REPOSITORY raspberrypi/pico-sdk
GIT_TAG 1.5.1
DOWNLOAD_ONLY TRUE
)
# download the sdk extras
CPMAddPackage(
NAME pico-extras
GITHUB_REPOSITORY raspberrypi/pico-extras
GIT_TAG sdk-1.5.1
DOWNLOAD_ONLY TRUE
)
# sdk configuration variables
set(PICO_BOARD pico_w CACHE STRING "" FORCE)
set(PICO_SDK_PATH ${CPM_PACKAGE_pico-sdk_SOURCE_DIR} CACHE PATH "")
set(PICO_EXTRAS_PATH ${CPM_PACKAGE_pico-extras_SOURCE_DIR} CACHE PATH "")
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
include(${PICO_EXTRAS_PATH}/external/pico_extras_import.cmake)
# Initialize the SDK
pico_sdk_init()
add_subdirectory(my_code)
This configures just fine, but I am unable to compile as it has selected the wrong toolchain. I also cannot manually select the arm compilers, as I get "cannot compile a simple test program".
I have resorted for the moment in adding the following code to my root file:
Brief Issue Summary
I am attempting to develop against the raspberry pi pico SDK in conjunction with CPM within vscode. This SDK comes with toolchains files and sets the CMAKE_TOOLCHAIN_FILE variable during part of its bootup. My simplified CMakeLists.txt looks like:
This configures just fine, but I am unable to compile as it has selected the wrong toolchain. I also cannot manually select the arm compilers, as I get "cannot compile a simple test program".
I have resorted for the moment in adding the following code to my root file:
However, this is not ideal. I would expect the cmake tools extension to detect when CMAKE_TOOLCHAINS_FILE is set and react accordingly.
Thank you guys for an awesome extension!!
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response