]> granicus.if.org Git - taglib/commitdiff
Added FindShlwapi.cmake in lieu of pragma comment() in fileref.h.
authorFestus Hagen <festushagen2002@yahoo.com>
Sat, 25 May 2013 05:51:26 +0000 (01:51 -0400)
committerFestus Hagen <festushagen2002@yahoo.com>
Sat, 25 May 2013 05:58:49 +0000 (01:58 -0400)
ConfigureChecks.cmake [changed mode: 0644->0755]
cmake/modules/FindShlwapi.cmake [new file with mode: 0755]
taglib/CMakeLists.txt [changed mode: 0644->0755]
taglib/fileref.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 46611a0..eda7a2b
@@ -218,6 +218,16 @@ endif()
 
 
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+
+if(WIN32)
+  find_package(SHLWAPI)
+  if(SHLWAPI_FOUND)
+    set(HAVE_SHLWAPI 1)
+  else()
+    set(HAVE_SHLWAPI 0)
+  endif()
+endif()
+
 find_package(CppUnit)
 if(NOT CppUnit_FOUND AND BUILD_TESTS)
   message(STATUS "CppUnit not found, disabling tests.")
diff --git a/cmake/modules/FindShlwapi.cmake b/cmake/modules/FindShlwapi.cmake
new file mode 100755 (executable)
index 0000000..cba253f
--- /dev/null
@@ -0,0 +1,14 @@
+#  *\r
+#  * It is what it is, you can do with it as you please.\r
+#  *\r
+#  * Just don't blame me if it teaches your computer to smoke!\r
+#  *\r
+#  *  -Enjoy\r
+#  *  fh :)_~\r
+#  *\r
+FIND_PATH(SHLWAPI_INCLUDE_DIR shlwapi.h)\r
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SHLWAPI REQUIRED_VARS SHLWAPI_LIBRARY SHLWAPI_INCLUDE_DIR)\r
+IF(SHLWAPI_FOUND)\r
+  SET(SHLWAPI_LIBRARIES ${SHLWAPI_LIBRARY} )\r
+ENDIF(SHLWAPI_FOUND)\r
+\r
old mode 100644 (file)
new mode 100755 (executable)
index 352f7e2..03eb15b
@@ -30,6 +30,10 @@ if(ZLIB_FOUND)
   include_directories(${ZLIB_INCLUDE_DIR})
 endif()
 
+if(SHLWAPI_FOUND)
+  include_directories(${SHLWAPI_INCLUDE_DIR})
+endif()
+
 set(tag_HDRS
   tag.h
   fileref.h
@@ -311,6 +315,10 @@ if(ZLIB_FOUND)
        target_link_libraries(tag ${ZLIB_LIBRARIES})
 endif()
 
+if(SHLWAPI_FOUND)
+  target_link_libraries(tag ${SHLWAPI_LIBRARIES})
+endif()
+
 set_target_properties(tag PROPERTIES
   VERSION ${TAGLIB_SOVERSION_MAJOR}.${TAGLIB_SOVERSION_MINOR}.${TAGLIB_SOVERSION_PATCH}
   SOVERSION ${TAGLIB_SOVERSION_MAJOR}
old mode 100644 (file)
new mode 100755 (executable)
index 95a7506..0f0c21a
 #include "taglib_export.h"
 #include "audioproperties.h"
 
-#if _WIN32
-# pragma comment(lib, "shlwapi.lib")
-#endif
-
 namespace TagLib {
 
   class Tag;