diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-06-20 18:00:48 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-06-20 18:00:48 (GMT) |
commit | 26c53fe14c4d6cabb8b7476f5c19ca7088199841 (patch) | |
tree | 0a21177b04547b365a0c82a52979315cb4adcd97 /Source/cmMakefile.cxx | |
parent | 490119d2aa31eaaeb99a145ab3e7b2aee2c957db (diff) | |
download | CMake-26c53fe14c4d6cabb8b7476f5c19ca7088199841.zip CMake-26c53fe14c4d6cabb8b7476f5c19ca7088199841.tar.gz CMake-26c53fe14c4d6cabb8b7476f5c19ca7088199841.tar.bz2 |
ENH: modified GET_TARGET_PROPERTIES to work with all targets
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2248ec4..abb29ea 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1079,7 +1079,8 @@ void cmMakefile::AddLibrary(const char* lname, int shared, target.SetInAll(true); target.GetSourceLists() = srcs; this->AddGlobalLinkInformation(lname, target); - m_Targets.insert(cmTargets::value_type(lname,target)); + cmTargets::iterator it = + m_Targets.insert(cmTargets::value_type(lname,target)).first; // Add an entry into the cache std::string libPath = lname; @@ -1088,7 +1089,27 @@ void cmMakefile::AddLibrary(const char* lname, int shared, AddCacheEntry(libPath.c_str(), 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); + target.SetProperty("LOCATION",target_location.c_str()); + // Add an entry into the cache std::string ltname = lname; ltname += "_LIBRARY_TYPE"; @@ -1133,6 +1154,26 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName, 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"; |