diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-05-09 12:25:45 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-05-09 12:25:45 (GMT) |
commit | 7f11536704d9f971cf5c8b0a2b490ccc6af58588 (patch) | |
tree | 05b5b24050a629bf9ceb59d743f77ca909448229 /Source/cmLocalGenerator.cxx | |
parent | 5af310502142252995ad5d74e66355be4094b7cc (diff) | |
download | CMake-7f11536704d9f971cf5c8b0a2b490ccc6af58588.zip CMake-7f11536704d9f971cf5c8b0a2b490ccc6af58588.tar.gz CMake-7f11536704d9f971cf5c8b0a2b490ccc6af58588.tar.bz2 |
ENH: now target names can be used in add_custom_command() and
add_custom_target() as COMMAND, and cmake will recognize them and replace
them with the actual output path of these executables. Also the dependency
will be added automatically. Test included.
ENH: moved TraceVSDependencies() to the end of GlobalGenerator::Configure(),
so it is done now in one central place
Alex
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 05ba04d..ec78daf 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -52,6 +52,7 @@ cmLocalGenerator::cmLocalGenerator() this->UseRelativePaths = false; this->Configured = false; this->EmitUniversalBinaryFlags = true; + this->IsMakefileGenerator = false; this->RelativePathsConfigured = false; this->PathConversionsSetup = false; } @@ -135,6 +136,30 @@ void cmLocalGenerator::ConfigureFinalPass() this->Makefile->ConfigureFinalPass(); } +void cmLocalGenerator::TraceDependencies() +{ + // Generate the rule files for each target. + cmTargets& targets = this->Makefile->GetTargets(); + for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) + { + // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace + // so don't build a projectfile for it + if ((t->second.GetType() != cmTarget::INSTALL_FILES) + && (t->second.GetType() != cmTarget::INSTALL_PROGRAMS) + && (t->second.GetType() != cmTarget::INSTALL_DIRECTORY) + && (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0) + && (t->second.GetPropertyAsBool("IMPORTED") == false)) + { + std::string projectFilename; + if (this->IsMakefileGenerator == false) // only use of this variable + { + projectFilename=t->second.GetName(); + } + t->second.TraceVSDependencies(projectFilename, this->Makefile); + } + } +} + void cmLocalGenerator::GenerateTestFiles() { if ( !this->Makefile->IsOn("CMAKE_TESTING_ENABLED") ) @@ -1987,6 +2012,20 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName, } //---------------------------------------------------------------------------- +std::string cmLocalGenerator::GetRealLocation(const char* inName, + const char* config) +{ + std::string outName=inName; + // Look for a CMake target with the given name. + cmTarget* target = this->GlobalGenerator->FindTarget(0, inName); + if ((target!=0) && (target->GetType()==cmTarget::EXECUTABLE)) + { + outName = target->GetLocation( config ); + } + return outName; +} + +//---------------------------------------------------------------------------- void cmLocalGenerator::AddSharedFlags(std::string& flags, const char* lang, bool shared) |