In the case a sysroot is specified (via CMAKE_SYSROOT or
CMAKE_OSX_SYSROOT for example), all the find_* functions will take
it into account during the search. Unfortunately this is not the case
for check_include_files() which is designed to test for headers
implicitely included by the compiler (it does not only search, but also
builds a minimal program which uses the header).
This diff adds a wrapper to the check_include_files() to make it able
to find the headers in the case a sysroot is specified. This will make
it possible to test for headers located in the Apple Framework when
building for OSX.
This cause no change in the software behavior, as the only header found
that was previously missed on OSX is sys/select.h, and its only use is
for the glibc compatibility layer which is unused on OSX.