Include folders for TInterpreter

How are the include folders determined for a TInterpreter? I know how to add a folder but I’m wondering which folders are used as default and how they are determined. My question stems from the fact that in my project I have a library with a class embedding a TInterpreter; when I use the interpreter in two different executables I get these:

-I
/home/mori/software/install/ROOT_6.10.06/etc
-I
/home/mori/software/install/ROOT_6.10.06/etc/cling
-I
/home/mori/software/install/ROOT_6.10.06/include
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/x86_64-pc-linux-gnu
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/backward
-isystem
/usr/local/include
-isystem
/home/mori/software/install/ROOT_6.10.06/etc/cling/lib/clang/3.9.0/include
-extern-c-isystem
/include
-extern-c-isystem
/usr/include
-I
/home/mori/software/develop/EventAnalysis/Debug/include
-I
/home/mori/software/develop/EventAnalysis/include
-I
/home/mori/software/develop/EventAnalysis
-I
/home/mori/software/develop/EventAnalysis/Debug/testsuite/persistence
-I
/home/mori/software/develop/EventAnalysis/Debug/testsuite/persistence/
-resource-dir
/home/mori/software/install/ROOT_6.10.06/etc/cling/lib/clang/3.9.0
-nostdinc++

in one case and these:

-I
/home/mori/software/install/ROOT_6.10.06/etc
-I
/home/mori/software/install/ROOT_6.10.06/etc/cling
-I
/home/mori/software/install/ROOT_6.10.06/include
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/x86_64-pc-linux-gnu
-I
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/…/…/…/…/include/c++/7.2.0/backward
-isystem
/usr/local/include
-isystem
/home/mori/software/install/ROOT_6.10.06/etc/cling/lib/clang/3.9.0/include
-extern-c-isystem
/include
-extern-c-isystem
/usr/include
-I
/home/mori/software/develop/EventAnalysis/Debug/include
-resource-dir
/home/mori/software/install/ROOT_6.10.06/etc/cling/lib/clang/3.9.0
-nostdinc++

in the other case. Both executables belong to the same cmake project, and I really can’t figure out why some folders are included only by the first one. Thanks.

If each binary is in a different subdirectory of your project, and you set properties per directory (i.e. using include_directories()) or per target, then only those directories/targets will get the extra includes. Could that be the case for you?

@amadio, thanks, you are correct. I tried to add a fake include path:

include_directories(/path/to/nothing)

to the CMakeLists of one of the executables, and that fake path now shows up in the list of include paths used by the embedded interpreter.
What puzzles me is that the fake path is not seen by the CMakeLists which compiles the library that embeds interpreter, so I wonder from where the TInterpreter gets it. I guessed that maybe the path was somehow hardcoded into the executable, but I can’t grep it.
Any clue about this?

I think I understood the issue. In the CMakeLists building the executable which shows up the fake include directory also a class dictionary is built and linked to the executable. The root_generate_dictionary macro hard codes into the dictionary all the include paths, which are then used at runtime by the embedded interpreter, I suppose.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.