Using clang in cross-compilation mode doesn't generate proper system include headers and macros for some IDEs
CodeBlocks and Eclipse generators (as well as the other IDEs that use them like QtCreator which uses CodeBlocks generator) have an additional module CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake that calls the compiler to find out system includes and defines. The problem is that the command that's called is incomplete for clang compilator that's run with arguments like --target, --gcc-toolchain or --sysroot. Moreover, if the CMAKE__COMPILER_ARG1 will include more than one argument the current module will not work correctly. Because of that, previously mentioned IDEs do not see certain system includes.
I prepared a quick patch that could be a base for official changes: CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.patch