[CMake] /usr/include filtered out of include paths?

O'Grady, Paul Christopher cpo at slac.stanford.edu
Wed Nov 22 00:11:47 EST 2017


Hi,

We’re using cmake/anaconda, including the anaconda-delivered gcc7 compilers.  As delivered by anaconda, I believe those compilers don’t search include paths like /usr/include and library paths like /lib64 /usr/lib64.  When I try to add those paths (e.g. /usr/include to cmake's target_include_directories) it appears to me that cmake filters them out (i.e. doesn’t put them in the list).  I can get other paths to show up without a problem.  I’m guessing cmake is assuming that the compiler will add those paths automatically.  If my understanding is correct, is there a way I can disable this filtering?

I have a workaround where I can modify environment variables like CFLAGS/CXXFLAGS/LDFLAGS before running cmake, but that felt somewhat ugly.

Thanks for any thoughts you might have,

chris



More information about the CMake mailing list