From 6f36b6736108b32c08af14fe976f02e34f8aade3 Mon Sep 17 00:00:00 2001
Message-Id: <6f36b6736108b32c08af14fe976f02e34f8aade3.1382734649.git.brad.king@kitware.com>
From: Brad King <brad.king@kitware.com>
Date: Fri, 25 Oct 2013 16:49:29 -0400
Subject: [PATCH] 14506: Add find_library debug output - try 1

---
 Source/cmFindLibraryCommand.cxx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index de52df7..0c9a5d1 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -320,6 +320,7 @@ void cmFindLibraryHelper::AddName(std::string const& name)
     }
   regex += "$";
   entry.Regex.compile(regex.c_str());
+  fprintf(stderr, "%s:%d regex=[%s]\n", __FILE__, __LINE__, regex.c_str());
   this->Names.push_back(entry);
 }
 
@@ -341,6 +342,8 @@ bool cmFindLibraryHelper::CheckDirectory(std::string const& path)
 bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
                                                 Name& name)
 {
+  fprintf(stderr, "%s:%d path=[%s] name.Raw=[%s]\n",
+          __FILE__, __LINE__, path.c_str(), name.Raw.c_str());
   // If the original library name provided by the user matches one of
   // the suffixes, try it first.  This allows users to search
   // specifically for a static library on some platforms (on MS tools
@@ -372,6 +375,7 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
   for(std::set<cmStdString>::const_iterator fi = files.begin();
       fi != files.end(); ++fi)
     {
+    fprintf(stderr, "%s:%d file [%s]\n", __FILE__, __LINE__, fi->c_str());
     std::string const& origName = *fi;
 #if defined(_WIN32) || defined(__APPLE__)
     std::string testName = cmSystemTools::LowerCase(origName);
@@ -380,6 +384,7 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
 #endif
     if(name.Regex.find(testName))
       {
+      fprintf(stderr, "%s:%d matches\n", __FILE__, __LINE__);
       this->TestPath = path;
       this->TestPath += origName;
       if(!cmSystemTools::FileIsDirectory(this->TestPath.c_str()))
@@ -410,6 +415,10 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
           }
         }
       }
+    else
+      {
+      fprintf(stderr, "%s:%d does not match\n", __FILE__, __LINE__);
+      }
     }
 
   // Use the best candidate found in this directory, if any.
-- 
1.8.4.rc3

