$OpenBSD: patch-Source_cmComputeLinkInformation_cxx,v 1.15 2016/04/29 10:34:33 dcoppa Exp $
--- Source/cmComputeLinkInformation.cxx.orig	Fri Apr 15 15:41:21 2016
+++ Source/cmComputeLinkInformation.cxx	Wed Apr 27 10:55:08 2016
@@ -698,10 +698,19 @@ void cmComputeLinkInformation::AddItem(std::string con
         }
       else
         {
-        // Use the full path given to the library file.
         this->Depends.push_back(item);
-        this->AddFullItem(item);
-        this->AddLibraryRuntimeInfo(item);
+        if(!this->OpenBSD)
+          {
+          // Use the full path given to the library file.
+          this->AddFullItem(item);
+          this->AddLibraryRuntimeInfo(item);
+          }
+        else
+          {
+          std::string file = cmSystemTools::GetFilenameName(item);
+          this->AddUserItem(file, false);
+          this->OrderLinkerSearchPath->AddLinkLibrary(item);
+          }
         }
       }
     else
@@ -1095,12 +1104,21 @@ void cmComputeLinkInformation::AddTargetItem(std::stri
     this->SharedLibrariesLinked.insert(target);
     }
 
-  // Handle case of an imported shared library with no soname.
-  if(this->NoSONameUsesPath &&
-     target->IsImportedSharedLibWithoutSOName(this->Config))
+  if(this->OpenBSD)
     {
-    this->AddSharedLibNoSOName(item);
-    return;
+    if(target->GetType() == cmState::SHARED_LIBRARY)
+      {
+      this->AddSharedLibNoSOName(item);
+      return;
+      }
+    } else {
+    // Handle case of an imported shared library with no soname.
+    if(this->NoSONameUsesPath &&
+       target->IsImportedSharedLibWithoutSOName(this->Config))
+      {
+      this->AddSharedLibNoSOName(item);
+      return;
+      }
     }
 
   // If this platform wants a flag before the full path, add it.
