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
  • Hey again Ubaid!

    For all of the cases you mentioned, it is done using configurations, not by adding more paths on CMakeLists.txt. 

    1. Add the config CONFIG_NRFX_GPIOTE=y so that you can use #include <nrfx_gpiote.h> in main.c. Take a look here.

    2. Add Mesh configs such as CONFIG_BT_MESH=y

    3. Add bluetooth configs such as CONFIG_BT=y

    For all drivers that are already a part of Zephyr you simply add configurations and include a headerfile, then everything will be ready for you to use the API. I would recommend that you go through this NCS tutorial, everything is explained there.

    Best regards,

    Elfving

  • Hello ,

    Thanks for the info, I understand about the configurations and menuconfigs, I was just looking at a way to include a file (which is not included by configurations), in a newly user defined file.

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

    So instead of having such a long include path in the include definition, how can i just add as #include "nrf_clock.h" and configure the build system to find the file..?

    "zephyr_library_include_directories(.)" in my CMakeLists.txt.

    Like in above case by including zephyr_library_include_directories(.) I am able to easily navigate to zephyr drivers files.!

    So i just want to know various available labels like zephyr_library_include_directories.

Reply
  • Hello ,

    Thanks for the info, I understand about the configurations and menuconfigs, I was just looking at a way to include a file (which is not included by configurations), in a newly user defined file.

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

    So instead of having such a long include path in the include definition, how can i just add as #include "nrf_clock.h" and configure the build system to find the file..?

    "zephyr_library_include_directories(.)" in my CMakeLists.txt.

    Like in above case by including zephyr_library_include_directories(.) I am able to easily navigate to zephyr drivers files.!

    So i just want to know various available labels like zephyr_library_include_directories.

Children
No Data
Related