I want to use CMake to check whether stdlib.h
has the getopt()
function (I know this has been true for many years, but I still need to perform this check, and this question is about the general issue).
I know how to check for the presence of an include file:
check_include_files(malloc.h HAVE_MALLOC_H)
but not the presence of a function made available by that file. How can I do that?
Edit: Actually getopt()
is never in stdlib.h
, it's typically in unistd.h
, but never mind, the question can stand as asked.