Use CMake to link Shlwapi on Windows

We use the SHGetValueA on Windows to retrieve the MHz of the processor
but this requires the shlwapi library. Previous to this patch the
library was linked with a MSVC specific pragma but there is no
guarantee that on Windows we will be using MSVC. Therefore, it is much
compile agnostic to use the standard CMAKE library linking mechanism
to provide the definition of SHGetValueA
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 40cd9ff..818e6d5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,6 +32,11 @@
   SOVERSION ${GENERIC_LIB_SOVERSION}
   )
 
+# We need extra libraries on Windows
+if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+  target_link_libraries(benchmark Shlwapi)
+endif()
+
 # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
 install(
   TARGETS benchmark
diff --git a/src/sysinfo.cc b/src/sysinfo.cc
index cc4fb1b..d6c8c7a 100644
--- a/src/sysinfo.cc
+++ b/src/sysinfo.cc
@@ -233,7 +233,6 @@
 // TODO: also figure out cpuinfo_num_cpus
 
 #elif defined OS_WINDOWS
-#pragma comment(lib, "shlwapi.lib")  // for SHGetValue()
   // In NT, read MHz from the registry. If we fail to do so or we're in win9x
   // then make a crude estimate.
   OSVERSIONINFO os;