# Try to find fnmatch.h for Fnmatch


IF (FNMATCH_INCLUDE_DIR)
	# Already in cache, be silent
	SET(FNMATCH_FIND_QUIETLY TRUE)
ENDIF (FNMATCH_INCLUDE_DIR)

FIND_PATH(FNMATCH_INCLUDE_DIR fnmatch.h)
 
IF(FNMATCH_INCLUDE_DIR) 
	 SET(FNMATCH_FOUND TRUE) 
ENDIF(FNMATCH_INCLUDE_DIR) 

IF(FNMATCH_FOUND) 
	set(CMAKE_REQUIRED_INCLUDES ${FNMATCH_INCLUDE_DIR})
	set(CMAKE_REQUIRED_INCLUDES)
	IF(NOT FNMATCH_FIND_QUIETLY) 
		MESSAGE(STATUS "Found Fnmatch headers: ${FNMATCH_INCLUDE_DIR}/fnmatch.h") 
	ENDIF(NOT FNMATCH_FIND_QUIETLY) 
ELSE(FNMATCH_FOUND) 
	IF(Fnmatch_FIND_REQUIRED) 
		MESSAGE(FATAL_ERROR "Could not find Fnmatch") 
	ENDIF(Fnmatch_FIND_REQUIRED) 
ENDIF(FNMATCH_FOUND) 

MARK_AS_ADVANCED(
	FNMATCH_INCLUDE_DIR
	FNMATCH_LIBRARIES
	FNMATCH_SECOND_ARGUMENT_IS_CONST
)
