Control: tags -1 + patch

The existing FindTaglib.cmake in this package uses the STRLESS function for 
lexical comparison of the version strings rather than using VERSION_LESS. It 
thus (wrongly) concludes that the minimum version requirement of 1.6 was not 
met when it finds version 1.11 installed.

        -- TagLib version not found: version searched :1.6, found 1.11
        CMake Error at cmake/modules/FindTaglib.cmake:132 (message):
          Could not find Taglib

The attached patch corrects this test allowing the package to build 
successfully.

cheers
Stuart

-- 
Stuart Prescott    http://www.nanonanonano.net/   stu...@nanonanonano.net
Debian Developer   http://www.debian.org/         stu...@debian.org
GPG fingerprint    90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7
Description: Fix version comparison for finding taglib

Existing cmake code doesn't do the min version comparison correctly.

(Closes: #840329)

--- a/cmake/modules/FindTaglib.cmake
+++ b/cmake/modules/FindTaglib.cmake
@@ -29,10 +29,10 @@
 
   exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION)
 
-  if(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}")
+  if(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
      message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}")
      set(TAGLIB_FOUND FALSE)
-  else(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}")
+  else(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
 
      exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES)
 
@@ -42,7 +42,7 @@
         set(TAGLIB_FOUND TRUE)
      endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
      string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}")
-  endif(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") 
+  endif(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
   mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES)
 
 else(TAGLIBCONFIG_EXECUTABLE)

Reply via email to