Nios® V Processor Software Developer Handbook

ID 743810
Date 10/12/2024
Public
Document Table of Contents

8.8.5.2.8. Adding Include Paths

By default, the generated BSP CMakeLists.txt include paths to find header files in /inc or <BSP type>/inc folders.

You might need to set up a header file directory hierarchy to logically organize your code. You can add additional include paths to your driver or software package using the add_sw_property command’s include_directory argument as follows:

add_sw_property include_directory UCOSII/inc/protocol/h

Note: If the path begins with the BSP type (e.g HAL, UCOSII, FREERTOS, or FreeRTOS-Kernel), the BSP type is removed and replaced with the value of the bsp_subdirectory property.

Additional include paths are added to the preprocessor flags in the BSP CMakeLists.txt file. These preprocessor flags allow BSP source files, as well as application and user library source files that reference the BSP, to find the include path while each source file is compiled.

Note: Adding additional include paths is not required if your source code includes header files with explicit path names. You can also specify the location of the header files with a #include directive similar to the following:

#include "protocol/h/ <filename>"