I'm in a situation where I should not disturb the existing CMakeLists.txt files, but I still should add some g++ system include directory to my build.
In other words, I need -isystem /path/to/my/include
added to my compiler flags, but when calling something like cmake ..
.
Maybe something like cmake .. -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -isystem /path/to/my/include"
? Is there a way to do this?
$CMAKE_CXX_FLAGS
, would reference a shell variable. Probably not what you would want. Actually, it should be useless on the command line. – Alexis Wilke