[CMake] CHECK_INCLUDE_FILES() and dependency headers

Alexander Neundorf a.neundorf-work at gmx.net
Thu Nov 19 15:30:27 EST 2009


On Thursday 19 November 2009, Jan Kneschke wrote:
> Hi,
>
> I have a few projects that have to check for net/if.h. At least on Mac
> OS X the fails with
> CHECK_INCLUDE_FILES() even if the file exists as it needs some types
> that are imported through

You mean check_include_file(), right ?
check_include_files() (plural) supports multiple files.
The implementation if the macro does this:

    FOREACH(FILE ${INCLUDE})
      SET(CMAKE_CONFIGURABLE_FILE_CONTENT
        "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
    ENDFOREACH(FILE)

Alex


More information about the CMake mailing list