summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-06-22 13:06:46 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-06-22 13:06:46 (GMT)
commit369308ca767367e5dd68fd783c830fd8a57ec751 (patch)
treedf00ee1c003cb33dd70fb622dfd85fd6d2a058cb /Source/cmMakefile.cxx
parent5fab6eebd651351ec3e712923cfa2d4b36788d74 (diff)
downloadCMake-369308ca767367e5dd68fd783c830fd8a57ec751.zip
CMake-369308ca767367e5dd68fd783c830fd8a57ec751.tar.gz
CMake-369308ca767367e5dd68fd783c830fd8a57ec751.tar.bz2
ENH: make LOCATION an computed property of the target and get rid of a bunch of const junk
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx51
1 files changed, 6 insertions, 45 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fdc5aa2..ba57c3e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -179,13 +179,13 @@ void cmMakefile::PrintStringVector(const char* s, const std::vector<std::pair<cm
// call print on all the classes in the makefile
-void cmMakefile::Print() const
+void cmMakefile::Print()
{
// print the class lists
std::cout << "classes:\n";
std::cout << " m_Targets: ";
- for (cmTargets::const_iterator l = m_Targets.begin();
+ for (cmTargets::iterator l = m_Targets.begin();
l != m_Targets.end(); l++)
{
std::cout << l->first << std::endl;
@@ -1078,10 +1078,10 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
target.ClearDependencyInformation( *this, lname );
target.SetInAll(true);
target.GetSourceLists() = srcs;
+ target.SetMakefile(this);
this->AddGlobalLinkInformation(lname, target);
- cmTargets::iterator it =
- m_Targets.insert(cmTargets::value_type(lname,target)).first;
-
+ m_Targets.insert(cmTargets::value_type(lname,target));
+
// Add an entry into the cache
std::string libPath = lname;
libPath += "_CMAKE_PATH";
@@ -1090,26 +1090,6 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
this->GetCurrentOutputDirectory(),
"Path to a library", cmCacheManager::INTERNAL);
- // set the LOCATION property of the target
- std::string target_location;
- target_location = this->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
- if ( target_location.size() == 0 )
- {
- target_location += this->GetCurrentOutputDirectory();
- }
- if ( target_location.size() > 0 )
- {
- target_location += "/";
- }
- const char* cfgid = this->GetDefinition("CMAKE_CFG_INTDIR");
- if ( cfgid && strcmp(cfgid, ".") != 0 )
- {
- target_location += cfgid;
- target_location += "/";
- }
- target_location += target.GetFullName(this);
- it->second.SetProperty("LOCATION",target_location.c_str());
-
// Add an entry into the cache
std::string ltname = lname;
ltname += "_LIBRARY_TYPE";
@@ -1150,30 +1130,11 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
target.SetType(cmTarget::EXECUTABLE, exeName);
target.SetInAll(true);
target.GetSourceLists() = srcs;
+ target.SetMakefile(this);
this->AddGlobalLinkInformation(exeName, target);
cmTargets::iterator it =
m_Targets.insert(cmTargets::value_type(exeName,target)).first;
- // set the LOCATION property of the target
- std::string target_location;
- target_location = this->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
- if ( target_location.size() == 0 )
- {
- target_location += this->GetCurrentOutputDirectory();
- }
- if ( target_location.size() > 0 )
- {
- target_location += "/";
- }
- const char* cfgid = this->GetDefinition("CMAKE_CFG_INTDIR");
- if ( cfgid && strcmp(cfgid, ".") != 0 )
- {
- target_location += cfgid;
- target_location += "/";
- }
- target_location += target.GetFullName(this);
- it->second.SetProperty("LOCATION",target_location.c_str());
-
// Add an entry into the cache
std::string exePath = exeName;
exePath += "_CMAKE_PATH";