From 16fb3f6db5fe287e173cab02203b11122cc02aaa Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 14 Jan 2008 16:30:18 -0800 Subject: Check for strncasecmp or _strnicmp --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 18f9a365..0520e240 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,16 @@ IF(NOT "${HAVE_STRCASECMP}") ADD_DEFINITIONS(-Dstrcasecmp=_stricmp) ENDIF() +CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP) +IF(NOT "${HAVE_STRNCASECMP}") + CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP) + IF(NOT "${HAVE__STRNICMP}") + MESSAGE(FATAL_ERROR "No case-insensitive size-limitted compare function found, please report!") + ENDIF() + + ADD_DEFINITIONS(-Dstrncasecmp=_strnicmp) +ENDIF() + CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) IF(NOT "${HAVE_SNPRINTF}") CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF) -- cgit v1.2.3