[CMake] Unable to find ctime_s

Alexander Neundorf a.neundorf-work at gmx.net
Sat May 23 13:01:40 EDT 2009


On Thursday 21 May 2009, David Carter wrote:
> I'm writing a configuration that will use Microsoft's secure functions
> when available, and use the standard versions on other platforms. I've
> got these lines in CMakeLists.txt:
>
> CHECK_FUNCTION_EXISTS("ctime_s" HAVE_CTIME_S)
> CHECK_FUNCTION_EXISTS("strcpy_s" HAVE_STRCPY_S)
> CHECK_FUNCTION_EXISTS("strncpy_s" HAVE_STRNCPY_S)
> CHECK_FUNCTION_EXISTS("strncat_s" HAVE_STRNCAT_S)
>
> It works for all functions except ctime_s, even though I know it's in
> there, defined in the time.h (or ctime for C++) header.

Maybe some preprocessor symbol has to be defined to get it enabled ?
Or it's just a macro and check_function_exists() expects a real function ?
In CMakeFile/CMakeError.log you should see the error message which was 
generated.

Alex


More information about the CMake mailing list