C/C++ : Adding Searching Include Directory

I have compiled a source code (Opendtect) using CMake. When I compile this program, the required include directory is not exist in the C/C++ searching path. Modified the Makefile is very hard, because this is the other people code.

We can copy all the include library to default C/C++ include directory (/usr/include). But, I dont recomended this. The other good method is adding searching include directory for my compiler. I get a documentation from gnu website about this :

CPATH specifiesalist of directories tobe searched asifspecified with-I,but after any paths given with-Ioptions on the command line.Thisenvironment variable isused regardless of which language isbeing preprocessed.

The remaining environment variables apply only when preprocessing the particular language indicated.Eachspecifiesalist of directories tobe searched asifspecified with-isystem,but after any paths given with-isystem options on the command line.

Inall these variables,an empty element instructs the compiler tosearch its current working directory.Empty elements can appear at the beginning orendofapath.Forinstance,ifthe value of CPATH is:/special/include,that has the same effect as‘-I.-I/special/include’.

The GNU have some of variable to adding new Include path directory to our program. Example, if we want to add new path include directory to our C++ code, we can use a command like this :