
# Try to find VLD library and include path.
# Once done this will define
#
# VLD_FOUND
# VLD_INCLUDE_DIR
# VLD_LIBRARIES
# 

IF (WIN32)
	if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
		set(VLD_LIB_PATHS
			"C:/Program Files (x86)/Visual Leak Detector/lib/Win64"
			"C:/Program Files/Visual Leak Detector/lib/Win64")
	else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
		set(VLD_LIB_PATHS
			"C:/Program Files (x86)/Visual Leak Detector/lib/Win32"
			"C:/Program Files/Visual Leak Detector/lib/Win32")
	endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

	FIND_PATH(VLD_INCLUDE_DIR vld.h
		"C:/Program Files (x86)/Visual Leak Detector/include"
		"C:/Program Files/Visual Leak Detector/include"
		DOC "The directory where vld.h resides"
	)
		
	FIND_LIBRARY(VLD_LIBRARIES
		NAMES vld
		PATHS
		${VLD_LIB_PATHS}
		DOC "The VLD library"
	)
ELSE (WIN32)
	message(SEND_ERROR "No VLD for this platform")
ENDIF (WIN32)

IF (VLD_INCLUDE_DIR)
	SET( VLD_FOUND 1 CACHE STRING "Set to 1 if VLD is found, 0 otherwise")
ELSE (VLD_INCLUDE_DIR)
	SET( VLD_FOUND 0 CACHE STRING "Set to 1 if VLD is found, 0 otherwise")
ENDIF (VLD_INCLUDE_DIR)

MARK_AS_ADVANCED( VLD_FOUND )
