Blame SOURCES/FindSamba.cmake-help-find-samba4-more-reliably.patch

92cace
From aaeae76bc3e5fa02601608bae85cdd1478843678 Mon Sep 17 00:00:00 2001
92cace
From: Rex Dieter <rdieter@math.unl.edu>
92cace
Date: Sat, 6 Apr 2013 05:10:39 -0500
92cace
Subject: [PATCH] FindSamba.cmake: help find samba4 more reliably
92cace
92cace
add PATH_SUFFIXES samba-4.0 and pkgconfig hints
92cace
---
92cace
 cmake/modules/FindSamba.cmake | 14 ++++++++++++--
92cace
 1 file changed, 12 insertions(+), 2 deletions(-)
92cace
92cace
diff --git a/cmake/modules/FindSamba.cmake b/cmake/modules/FindSamba.cmake
92cace
index 16522c6..ec1179d 100644
92cace
--- a/cmake/modules/FindSamba.cmake
92cace
+++ b/cmake/modules/FindSamba.cmake
92cace
@@ -17,10 +17,20 @@ if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
92cace
     set(Samba_FIND_QUIETLY TRUE)
92cace
 endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
92cace
 
92cace
-find_path(SAMBA_INCLUDE_DIR NAMES libsmbclient.h )
92cace
+# use pkg-config to get the directories and then use these values
92cace
+# in the FIND_PATH() and FIND_LIBRARY() calls
92cace
+find_package(PkgConfig)
92cace
+pkg_check_modules(PC_LIBSMBCLIENT QUIET smbclient)
92cace
 
92cace
-find_library(SAMBA_LIBRARIES NAMES smbclient )
92cace
+find_path(SAMBA_INCLUDE_DIR NAMES libsmbclient.h PATH_SUFFIXES samba-4.0
92cace
+          HINTS
92cace
+          ${PC_LIBSMBCLIENT_INCLUDEDIR}
92cace
+          ${PC_LIBSMBCLIENT_INCLUDE_DIRS})
92cace
 
92cace
+find_library(SAMBA_LIBRARIES NAMES smbclient
92cace
+             HINTS
92cace
+             ${PC_LIBSMBCLIENT_LIBDIR}
92cace
+             ${PC_LIBSMBCLIENT_LIB_DIRS})
92cace
 
92cace
 if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
92cace
    set(SAMBA_FOUND TRUE)
92cace
-- 
92cace
1.8.1.4
92cace