I am having an issue with the compiler not reading a header file. I am working with a one-wire library for reading the temperature on a DS18B20 using a Raspberry Pi Pico, I copied it through aa git and made a new directory for it via the command prompt using build tools. To use this library for my project I stored this in the directory C:SDKpico-sdklibMyProjectLibpico_one_wire where it has subdirectories that hold the source code and header file. This is separate from my project file itself to avoid clutter. I don’t see much issue with this approach since I know the directories I will utilize. I am using CMake to build the project, address these directories, and target the libraries containing the header file and source code. So far I was able to address the source file one_wire.cpp without issue but the issue with the header file and the compiler remains. I get the error message on the line I stated #include "one_wire.h"
which states fatal error: one_wire.h: No such file or directory
. My question is, what is causing the compiler to fail to read the header while stating compiling? I suspect it has to do with my CMake file itself, but I do not know how since I included the same directory below. Any help would be appreciated, thank you. Here is my Cmake file below
cmake_minimum_required(VERSION 3.13)
include(pico_sdk_import.cmake)
project(DS18B20 C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
include_directories(${PICO_SDK_PATH}/lib/MyProjectLib/pico_one_wire)
pico_sdk_init()
add_executable(DS18B20
DS18B20.cpp
${PICO_SDK_PATH}/lib/MyProjectLib/pico_one_wire/source/one_wire.cpp
)
pico_enable_stdio_usb(DS18B20 1)
pico_enable_stdio_uart(DS18B20 1)
pico_add_extra_outputs(DS18B20)
target_link_libraries(DS18B20 pico_stdlib hardware_gpio pico_one_wire)