summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-18 15:39:22 (GMT)
committerBrad King <brad.king@kitware.com>2008-08-18 15:39:22 (GMT)
commit061d20be3869d53e0dee4c72b4f9e0202fe6b197 (patch)
treee3b1e82517d89a5795e6d1927e49de21d0294983 /Source/cmComputeLinkDepends.cxx
parent0bf093fd172951a8da7fc892da95c5c37a3354e2 (diff)
downloadCMake-061d20be3869d53e0dee4c72b4f9e0202fe6b197.zip
CMake-061d20be3869d53e0dee4c72b4f9e0202fe6b197.tar.gz
CMake-061d20be3869d53e0dee4c72b4f9e0202fe6b197.tar.bz2
ENH: Add UNKNOWN type for IMPORTED libraries
When creating an IMPORTED target for a library that has been found on disk, it may not be known whether the library is STATIC or SHARED. However, the library may still be linked using the file found from disk. Use of an IMPORTED target is still important to allow per-configuration files to be specified for the library. This change creates an UNKNOWN type for IMPORTED library targets. The IMPORTED_LOCATION property (and its per-config equivalents) specifies the location of the library. CMake makes no assumptions about the library that cannot be inferred from the file on disk. This will help projects and find-modules import targets found on disk or specified by the user.
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 177ec58..df329a6 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -891,6 +891,14 @@ void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
}
//----------------------------------------------------------------------------
+static bool cmComputeLinkDependsNotStatic(cmTarget* tgt)
+{
+ return (tgt &&
+ tgt->GetType() != cmTarget::STATIC_LIBRARY &&
+ tgt->GetType() != cmTarget::UNKNOWN_LIBRARY);
+}
+
+//----------------------------------------------------------------------------
void cmComputeLinkDepends::PreserveOriginalEntries()
{
// Skip the part of the input sequence that already appears in the
@@ -901,7 +909,7 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
out != this->FinalLinkOrder.end())
{
cmTarget* tgt = this->EntryList[*in].Target;
- if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
+ if(cmComputeLinkDependsNotStatic(tgt))
{
// Skip input items known to not be static libraries.
++in;
@@ -924,7 +932,7 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
while(in != this->OriginalEntries.end())
{
cmTarget* tgt = this->EntryList[*in].Target;
- if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
+ if(cmComputeLinkDependsNotStatic(tgt))
{
// Skip input items known to not be static libraries.
++in;