macro(FindProtobuf)
	set(PROTOBUF_INSTALL_DIR PROTOBUF_INSTALL_DIR-NOTFOUND CACHE PATH "Protobuf installation directory. Must contain a lib and include directory.")
	if(NOT PROTOBUF_INSTALL_DIR)
	  message(FATAL_ERROR "Protobuf installation path wasn't provided. Use -DProtobuf_INSTALL_DIR:PATH= configuration option.")  
	endif()
	if(MSVC)
		set(Protobuf_DIR ${PROTOBUF_INSTALL_DIR}/cmake/)
	else()
		set(Protobuf_DIR ${PROTOBUF_INSTALL_DIR}/lib/cmake/protobuf/)
	endif()
	set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "Define protobuf macros" FORCE)
	include(${Protobuf_DIR}/protobuf-config.cmake)
endmacro(FindProtobuf)
