[CMake] Unable to find ctime_s

David Carter dcarter at davidcarter.ca
Thu May 21 12:35:46 EDT 2009


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. So I tried the  
following:

FIND_PATH(CTIME_INCLUDE_DIR time.h)

and it's unable to find the header.

Suggestions?

TIA,
Dave

----
Custom Software Solutions
http://www.davidcarter.ca
http://davidcarterca.wordpress.com





More information about the CMake mailing list