summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexRelativePaths
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-01-13 23:18:32 (GMT)
committerBrad King <brad.king@kitware.com>2006-01-13 23:18:32 (GMT)
commit22c62c9e65817e25b077f88222c682efa0188ccb (patch)
tree077abb80fc469c06f08cc4509ff72bcbee8384c7 /Tests/ComplexRelativePaths
parent262295615925c082ec3f98c3fc1f6c259d09ee6f (diff)
downloadCMake-22c62c9e65817e25b077f88222c682efa0188ccb.zip
CMake-22c62c9e65817e25b077f88222c682efa0188ccb.tar.gz
CMake-22c62c9e65817e25b077f88222c682efa0188ccb.tar.bz2
BUG: Sweeping changes to cleanup computation of target names. This should
fix many bugs related to target names being computed inconsistently. - Centralized computation of a target's file name to a method in cmTarget. Now that global knowledge is always available the *_CMAKE_PATH cache variables are no longer needed. - Centralized computation of link library command lines and link directory search order. - Moved computation of link directories needed to link CMake targets to be after evaluation of linking dependencies. This also removed alot of duplicate code in which each version had its own bugs. This commit is surrounded by the tags CMake-TargetNameCentralization1-pre and CMake-TargetNameCentralization1-post so make the large set of changes easy to identify.
Diffstat (limited to 'Tests/ComplexRelativePaths')
-rw-r--r--Tests/ComplexRelativePaths/Executable/complex.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx
index c8b6f00..9fac9ab 100644
--- a/Tests/ComplexRelativePaths/Executable/complex.cxx
+++ b/Tests/ComplexRelativePaths/Executable/complex.cxx
@@ -36,20 +36,19 @@ bool TestLibraryOrder(bool shouldFail)
rm += "/libA.a";
cmSystemTools::RemoveFile(rm.c_str());
}
- cmTarget target;
- target.AddLinkDirectory(Adir.c_str());
- target.AddLinkDirectory(Bdir.c_str());
- target.AddLinkDirectory(Cdir.c_str());
- target.AddLinkDirectory("/lib/extra/stuff");
-
+ std::vector<std::string> linkLibraries;
+ std::vector<std::string> linkDirectories;
+ linkDirectories.push_back(Adir);
+ linkDirectories.push_back(Bdir);
+ linkDirectories.push_back(Cdir);
+ linkDirectories.push_back("/lib/extra/stuff");
Adir += "/libA.a";
Bdir += "/libB.a";
Cdir += "/libC.a";
-
- target.AddLinkLibrary(Adir.c_str(), cmTarget::GENERAL);
- target.AddLinkLibrary(Bdir.c_str(), cmTarget::GENERAL);
- target.AddLinkLibrary(Cdir.c_str(), cmTarget::GENERAL);
- target.AddLinkLibrary("-lm", cmTarget::GENERAL);
+ linkLibraries.push_back(Adir);
+ linkLibraries.push_back(Bdir);
+ linkLibraries.push_back(Cdir);
+ linkLibraries.push_back("-lm");
std::vector<cmStdString> sortedpaths;
std::vector<cmStdString> linkItems;
cmOrderLinkDirectories orderLibs;
@@ -57,7 +56,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkPrefix("lib");
- orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");
+ orderLibs.SetLinkInformation("test", linkLibraries, linkDirectories);
bool ret = orderLibs.DetermineLibraryPathOrder();
orderLibs.GetLinkerInformation(sortedpaths, linkItems);
std::cout << "Sorted Link Paths:\n";