]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix to find the correct native 'libxml2' library.
authorakl <akl@opencascade.com>
Tue, 19 Feb 2013 12:30:54 +0000 (12:30 +0000)
committerakl <akl@opencascade.com>
Tue, 19 Feb 2013 12:30:54 +0000 (12:30 +0000)
salome_adm/cmake_files/deprecated/FindLIBXML2.cmake

index 5eafb937db23de026bbef5c98682891f38e6878a..8ff923e07de69492e14e20954d3dfb7487d95f8b 100644 (file)
@@ -112,7 +112,14 @@ IF(LIBXML2_STATUS)
   IF(WINDOWS)
     FIND_LIBRARY(LIBXML2_LIB libxml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
   ELSE(WINDOWS)
-    FIND_LIBRARY(LIBXML2_LIB xml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
+    IF(LIBXML2_LIB_PATHS)
+      FIND_LIBRARY(LIBXML2_LIB xml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
+    ELSE(LIBXML2_LIB_PATHS)
+      # use pkg-config to get the directories and then use these values in FIND_LIBRARY()
+      FIND_PACKAGE(PkgConfig QUIET)
+      PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
+      FIND_LIBRARY(LIBXML2_LIB xml2 HINTS ${PC_LIBXML_LIBDIR} ${PC_LIBXML_LIBRARY_DIRS})
+    ENDIF(LIBXML2_LIB_PATHS)
   ENDIF(WINDOWS)
   SET(LIBXML2_LIBS)
   IF(LIBXML2_LIB)