THRIFT-3442 Run CMake tests on Appveyor
Client: Test
Patch: Nobuaki Sukegawa

This closes #713
diff --git a/build/cmake/FindLibevent.cmake b/build/cmake/FindLibevent.cmake
index 1eac315..2bcd709 100644
--- a/build/cmake/FindLibevent.cmake
+++ b/build/cmake/FindLibevent.cmake
@@ -6,14 +6,16 @@
 # LIBEVENT_LIBRARIES, LibEvent libraries
 # Libevent_FOUND, If false, do not try to use libevent
 
-set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}")
+set(LIBEVENT_ROOT CACHE PATH "Root directory of libevent installation")
+set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}" ${LIBEVENT_ROOT})
 foreach(prefix ${LibEvent_EXTRA_PREFIXES})
   list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include")
   list(APPEND LibEvent_LIBRARIES_PATHS "${prefix}/lib")
 endforeach()
 
 find_path(LIBEVENT_INCLUDE_DIRS event.h PATHS ${LibEvent_INCLUDE_PATHS})
-find_library(LIBEVENT_LIBRARIES NAMES event PATHS ${LibEvent_LIBRARIES_PATHS})
+# "lib" prefix is needed on Windows
+find_library(LIBEVENT_LIBRARIES NAMES event libevent PATHS ${LibEvent_LIBRARIES_PATHS})
 
 if (LIBEVENT_LIBRARIES AND LIBEVENT_INCLUDE_DIRS)
   set(Libevent_FOUND TRUE)