FIND_PROGRAM(MONO_EXECUTABLE mono)
FIND_PROGRAM(MONO_MCS_EXECUTABLE dmcs)

IF(WIN32)
	FIND_PATH(MONO_INCLUDE_DIR mono/jit/jit.h)
	SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
	SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" "")
	FIND_LIBRARY(MONO_LIBRARY NAMES mono-2.0 DOC "The Mono Library")
ELSEIF(UNIX)
	FIND_PACKAGE(PkgConfig REQUIRED)
	PKG_SEARCH_MODULE(MONO mono-2 REQUIRED QUIET)
	FIND_PATH(MONO_INCLUDE_DIR mono/jit/jit.h HINTS ${MONO_INCLUDE_DIR} ${MONO_INCLUDE_DIRS})
	FIND_LIBRARY(MONO_LIBRARY NAMES mono-2.0)
ENDIF()

SET(MONO_INCLUDE_DIRS ${MONO_INCLUDE_DIR})
SET(MONO_LIBRARIES ${MONO_LIBRARY})

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MONO DEFAULT_MSG
		MONO_EXECUTABLE MONO_MCS_EXECUTABLE MONO_INCLUDE_DIR MONO_LIBRARY)

MARK_AS_ADVANCED(MONO_EXECUTABLE MONO_MCS_EXECUTABLE MONO_INCLUDE_DIR MONO_LIBRARY)