Answer the question
In order to leave comments, you need to log in
Alternative for AC_CHECK_HEADERS in CMake
Now I'm trying to transfer the project from Autoconf to CMake. A number of questions have arisen.
1. What to do with view designs
AC_CHECK_HEADERS(stdio.h stdlib.h string.h)
okay, just make a few calls likecheck_include_file("stdio.h" HAVE_STDIO_H)
And here's how to deal withс AC_CHECK_HEADERS(resolv.h, [], [], [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
])
remains a question for me. If I understand the autoconf documentation correctly, the fourth parameter is the instructions to the preprocessor that it must include in the test file before the one passed first. Please explain to the layman in this area, otherwise I can’t figure it out.
Answer the question
In order to leave comments, you need to log in
If you believe the documentation (http://www.vtk.org/Wiki/CMake:How_To_Write_Platform_Checks), then you need to do something like this:
CHECK_INCLUDE_FILES("sys/types.h;resolv.conf" HAVE_RESOLV_CONF)
For more complex things (for example, not just including other includes before), you will need to write your own module for cmake... Well, besides, there is also the CMAKE_EXTRA_INCLUDE_FILES variable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question