aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-14 16:30:18 -0800
committerChris Robinson <[email protected]>2008-01-14 16:30:18 -0800
commit16fb3f6db5fe287e173cab02203b11122cc02aaa (patch)
tree397cc8ec9bd77329b7006a14f67685f1753dd04b /CMakeLists.txt
parenta2e25226125ff12b5294055dd01e247197270265 (diff)
Check for strncasecmp or _strnicmp
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
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)