Hello, I have a need to include a header file that I have defined in one of the Connect SDK .c files. For the purposes of this question, let's say I want to #include "myfunctionsandvariables.h" in azure_iot_hub.c. An example of my file structure in my linux home directory is below.
-ncs
-bootloader
-mbedtls
-modules
-nrf
-nrfxlib
-test
-tools
-zephyr
-.west
-src
-myproject
-Kconfig
-include
-myfunctionsandvariables.h
-src
-main.c
-myfunctionsandvariables.c
-myboard
-build
-boardoverlays
-myboardoverlay.overlay
-prj.conf
-CMakeLists.txt
-Kconfig
I am struggling to configure my CMakeLists.txt files so that this header file can be included in (for example) azure_iot_hub.c. The files in "myproject" are configured so that I can include myfunctionsandvariables.h at the top of main.c, then and build without issue (if I use an unchanged azure_iot_hub.c).
I have attempted to add the following line to ~/ncs/nrf/CMakeLists.txt, and several similar permutations with no success. The error that I get when building is "fatal error: myfunctionsandvariables.h: No such file or directory"
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include/)
Could you please give any guidance on how to go about accomplishing this?