diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-04 17:19:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-05 16:20:46 (GMT) |
commit | a45fed81e5fd5d9b280c8dd70d50c9606a982a0b (patch) | |
tree | 138c275f924984a8e1aea8e9033cc29ea82d7cf3 /Source/cmGeneratorTarget.cxx | |
parent | f0aa660772565545cbcda9ed8ae946b8d5097416 (diff) | |
download | CMake-a45fed81e5fd5d9b280c8dd70d50c9606a982a0b.zip CMake-a45fed81e5fd5d9b280c8dd70d50c9606a982a0b.tar.gz CMake-a45fed81e5fd5d9b280c8dd70d50c9606a982a0b.tar.bz2 |
cmGeneratorTarget: Move GetCompilePDBPath from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2b3ebee..a125e47 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -657,6 +657,51 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files, } //---------------------------------------------------------------------------- +std::string +cmGeneratorTarget::GetCompilePDBName(const std::string& config) const +{ + std::string prefix; + std::string base; + std::string suffix; + this->Target->GetFullNameInternal(config, false, prefix, base, suffix); + + // Check for a per-configuration output directory target property. + std::string configUpper = cmSystemTools::UpperCase(config); + std::string configProp = "COMPILE_PDB_NAME_"; + configProp += configUpper; + const char* config_name = this->Target->GetProperty(configProp); + if(config_name && *config_name) + { + return prefix + config_name + ".pdb"; + } + + const char* name = this->Target->GetProperty("COMPILE_PDB_NAME"); + if(name && *name) + { + return prefix + name + ".pdb"; + } + + return ""; +} + +//---------------------------------------------------------------------------- +std::string +cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const +{ + std::string dir = this->Target->GetCompilePDBDirectory(config); + std::string name = this->GetCompilePDBName(config); + if(dir.empty() && !name.empty()) + { + dir = this->Target->GetPDBDirectory(config); + } + if(!dir.empty()) + { + dir += "/"; + } + return dir + name; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::HasSOName(const std::string& config) const { // soname is supported only for shared libraries and modules, |