From 00b7712a5910932f5bb8e333e6a28883f506092a Mon Sep 17 00:00:00 2001
From: k1ll <karl.glatzer@gmx.de>
Date: Sat, 22 Jun 2013 11:33:22 +0200
Subject: [PATCH] Fix shlwapi include case and add the lib for linking when
 building for windows

---
 components/CMakeLists.txt        | 4 ++++
 components/files/windowspath.cpp | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt
index 38fcd88e3..5bd18d119 100644
--- a/components/CMakeLists.txt
+++ b/components/CMakeLists.txt
@@ -170,6 +170,10 @@ if (GIT_CHECKOUT)
     add_dependencies (components git-version)
 endif (GIT_CHECKOUT)
 
+if (WIN32)
+target_link_libraries(components shlwapi)
+endif()
+
 # Fix for not visible pthreads functions for linker with glibc 2.15
 if (UNIX AND NOT APPLE)
 target_link_libraries(components ${CMAKE_THREAD_LIBS_INIT})
diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp
index 0df782702..ece4049a8 100644
--- a/components/files/windowspath.cpp
+++ b/components/files/windowspath.cpp
@@ -6,9 +6,7 @@
 
 #include <windows.h>
 #include <shlobj.h>
-#include <Shlwapi.h>
-
-#pragma comment(lib, "Shlwapi.lib")
+#include <shlwapi.h>
 
 #include <boost/locale.hpp>
 namespace bconv = boost::locale::conv;