我使用 ESP-IOT-SOLU
tiON 时遇到了一个问题。编译时报错WARNING Can't detect IOT_SOLUTION_PATH in your environment...
按照官网的描述 我尝试添加环境变量 set IOT_SOLUTION_PATH=C:espesp-iot-solution (我修改了路径,把IOT包放在了eps-idf目录下)
命令运行后没有任何反应 ESP-IDF生成的控制台 和 WIN10自带的控制台 我都试过了 没有用
在运行这条命令后 使用 set set IOT_SOLUTION_PATH 查询环境变量 并不能查到
最后手动添加了路径
%IOT_SOLUTION_PATH% 和 IOT_SOLUTION_PATH
大家不要笑,从某32转过来的,没有弄过ESP这种环境,没结果就乱弄。
在VSCODE里工程根目录的CMakeList文件(并不是main函数同级的拿一个list)里有这样的描述,我复制的例子
cmake_minimum_required(VERSION 3.5)
#If IOT_SOLUTION_PATH is not defined, use relative path as default value
if(NOT DEFINED ENV{IOT_SOLUTION_PATH})
get_filename_component(IOT_SOLUTION_PATH "${CMAKE_SOURCE_DIR}/../../../.." ABSOLUTE)
set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH})
message(WARNING "Can't detect IOT_SOLUTION_PATH in your environment, we infer it is $ENV{IOT_SOLUTION_PATH}")
endif()
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS
$ENV{IOT_SOLUTION_PATH}/components/usb/tinyusb
$ENV{IOT_SOLUTION_PATH}/examples/common_components/boards
$ENV{IOT_SOLUTION_PATH}/components/bus
$ENV{IOT_SOLUTION_PATH}/components/button
$ENV{IOT_SOLUTION_PATH}/examples/common_components/boards/esp32-devkitc-v4)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include($ENV{IOT_SOLUTION_PATH}/component.cmake)
project(usb_wireless_disk)
我想问题就出现在 if(NOT DEFINED ENV{IOT_SOLUTION_PATH})上,那么请问我该怎么做?多谢!