From b3f3eeeec7f875e68a386c4839b577ff91d02bec Mon Sep 17 00:00:00 2001 From: Festus Hagen Date: Sat, 25 May 2013 01:51:26 -0400 Subject: [PATCH] Added FindShlwapi.cmake in lieu of pragma comment() in fileref.h. --- ConfigureChecks.cmake | 10 ++++++++++ cmake/modules/FindShlwapi.cmake | 14 ++++++++++++++ taglib/CMakeLists.txt | 8 ++++++++ taglib/fileref.h | 4 ---- 4 files changed, 32 insertions(+), 4 deletions(-) mode change 100644 => 100755 ConfigureChecks.cmake create mode 100755 cmake/modules/FindShlwapi.cmake mode change 100644 => 100755 taglib/CMakeLists.txt mode change 100644 => 100755 taglib/fileref.h diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake old mode 100644 new mode 100755 index 46611a00..eda7a2b6 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -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 index 00000000..cba253f0 --- /dev/null +++ b/cmake/modules/FindShlwapi.cmake @@ -0,0 +1,14 @@ +# * +# * It is what it is, you can do with it as you please. +# * +# * Just don't blame me if it teaches your computer to smoke! +# * +# * -Enjoy +# * fh :)_~ +# * +FIND_PATH(SHLWAPI_INCLUDE_DIR shlwapi.h) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SHLWAPI REQUIRED_VARS SHLWAPI_LIBRARY SHLWAPI_INCLUDE_DIR) +IF(SHLWAPI_FOUND) + SET(SHLWAPI_LIBRARIES ${SHLWAPI_LIBRARY} ) +ENDIF(SHLWAPI_FOUND) + diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt old mode 100644 new mode 100755 index 352f7e2e..03eb15b5 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -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} diff --git a/taglib/fileref.h b/taglib/fileref.h old mode 100644 new mode 100755 index 95a7506d..0f0c21a4 --- a/taglib/fileref.h +++ b/taglib/fileref.h @@ -32,10 +32,6 @@ #include "taglib_export.h" #include "audioproperties.h" -#if _WIN32 -# pragma comment(lib, "shlwapi.lib") -#endif - namespace TagLib { class Tag;