This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Include labels/variables for nCS

Hello,

With reference to Case ID:278209, I wanted to include a driver file, for which I was suggested to add the label/variable "zephyr_library_include_directories(.)" in my CMakeLists.txt.

So with the label/variable "zephyr_library_include_directories(.)" I can include most of the zephyr driver files which is fine.

My query is, in SDK there are plenty of files other than zephyr driver files, so what are the various available labels like "zephyr_library_include_directories(.)" that I can add to my CMakeLists.txt to include other nCS files...?

For example:
1. To include files from the path nCS\v1.7.0\modules\hal\nordic\nrfx\drivers\include, what is the label/variable to be added in CMakeLists.txt..?
2. To include files from nCS\v1.7.0\nrf\subsys\bluetooth\mesh, what is the label/variable to be added in CMakeLists.txt..?
3.  To include files from nCS\v1.7.0\zephyr\include\bluetooth, what is the label/variable to be added in CMakeLists.txt..?


 

Parents
  • Ubaid_M said:
    In some file "Sample_file.c", I want to: #include "nCS/v1.7.0/modules/hal/nordic/nrfx/hal/nrf_clock.h"

    To make CMakeLists add any given folder to the path you can use zephyr_include_directories(C:/Users/ ...), and maneuver your way to the files you want. If you want a smaller path name there as well, you can use environment variables, like we have done in several of our samples. For instance $ENV{ZEPHYR_BASE} would take you to your zephyr folder. I see that $PWD takes you to your NCS version, that might be useful to you.

    Though with the example you provided you can simply use #include <hal/nrf_clock.h> in your file, as the nrfx config adds the nrfx folder to the path. 

    When it comes to other arguments similar to zephyr_include_directories I am a little uncertain, as I haven't found myself needing much more. There is a list of them here though.

    Was this what you were looking for, or am I misunderstanding you?

    Best regards,

    Elfving

Reply
  • Ubaid_M said:
    In some file "Sample_file.c", I want to: #include "nCS/v1.7.0/modules/hal/nordic/nrfx/hal/nrf_clock.h"

    To make CMakeLists add any given folder to the path you can use zephyr_include_directories(C:/Users/ ...), and maneuver your way to the files you want. If you want a smaller path name there as well, you can use environment variables, like we have done in several of our samples. For instance $ENV{ZEPHYR_BASE} would take you to your zephyr folder. I see that $PWD takes you to your NCS version, that might be useful to you.

    Though with the example you provided you can simply use #include <hal/nrf_clock.h> in your file, as the nrfx config adds the nrfx folder to the path. 

    When it comes to other arguments similar to zephyr_include_directories I am a little uncertain, as I haven't found myself needing much more. There is a list of them here though.

    Was this what you were looking for, or am I misunderstanding you?

    Best regards,

    Elfving

Children
No Data
Related