Nios® V Processor Software Developer Handbook

ID 743810
Date 7/20/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.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>"