[CMake] CheckIncludeFiles: how to use?

David Cole david.cole at kitware.com
Wed Jul 1 09:48:15 EDT 2009


Try:CHECK_INCLUDE_FILES("unistd.h;stdio.h" var)

Or:
SET(files unistd.h stdio.h)
CHECK_INCLUDE_FILES("${files}" var)


On Wed, Jul 1, 2009 at 4:13 AM, Marcel Loose <loose at astron.nl> wrote:

> Hi all,
>
> Maybe it's because of a partially sleepless night, but I can't seem to
> figure out how I should use check_include_files().
>
> According to the docs (and the implementation) this macro should be used
> as:
>
>  CHECK_INCLUDE_FILES(INCLUDE VARIABLE)
>
> where INCLUDE should contain the list of files to include.
> Problem is, however, that the following doesn't work:
>
>  CHECK_INCLUDE_FILES(unistd.h stdio.h var)
>
> because this will assign "unistd.h" to the variable INCLUDE and
> "stdio.h" to the variable VARIABLE.
>
> The following also doesn't work:
>
>  SET(files unistd.h stdio.h)
>  CHECK_INCLUDE_FILES(files var)
>
> because the variable INCLUDE is not handled as the name of the list
> containing the header files, but as the name of the header file itself.
>
> Am I missing something here, or is this a bug in check_include_files()?
>
> Best regards,
> Marcel Loose.
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090701/e4665b9f/attachment-0001.htm>


More information about the CMake mailing list