summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-21 17:22:12 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-21 17:22:12 (GMT)
commitd83b4cd255bcd13b5b7e4279a6e3e959fcb58688 (patch)
tree1987a83567e98da043994e7fa870fe48c7b08c8a /Source/cmGlobalUnixMakefileGenerator3.cxx
parent6586149d64be27694652b40bfbcc4d19f6c2c5eb (diff)
downloadCMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.zip
CMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.tar.gz
CMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.tar.bz2
ENH: Add a depends check step to custom targets. Add support for the IMPLICIT_DEPENDS feature of custom commands when building in custom targets. Convert multiple-output pair checks to be per-target instead of global.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx87
1 files changed, 9 insertions, 78 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index f3a5dde..a723967 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -133,16 +133,6 @@ void cmGlobalUnixMakefileGenerator3
}
//----------------------------------------------------------------------------
-void
-cmGlobalUnixMakefileGenerator3
-::AddMultipleOutputPair(const char* depender, const char* dependee)
-{
- MultipleOutputPairsType::value_type p(depender, dependee);
- this->MultipleOutputPairs.insert(p);
-}
-
-
-//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3::Generate()
{
// first do superclass method
@@ -373,62 +363,6 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
this->WriteMainCMakefileLanguageRules(cmakefileStream,
this->LocalGenerators);
-
- if(!this->MultipleOutputPairs.empty())
- {
- cmakefileStream
- << "\n"
- << "SET(CMAKE_MULTIPLE_OUTPUT_PAIRS\n";
- for(MultipleOutputPairsType::const_iterator pi =
- this->MultipleOutputPairs.begin();
- pi != this->MultipleOutputPairs.end(); ++pi)
- {
- cmakefileStream << " \"" << pi->first << "\" \""
- << pi->second << "\"\n";
- }
- cmakefileStream << " )\n\n";
- }
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalUnixMakefileGenerator3::CheckMultipleOutputs(cmMakefile* mf,
- bool verbose)
-{
- // Get the string listing the multiple output pairs.
- const char* pairs_string = mf->GetDefinition("CMAKE_MULTIPLE_OUTPUT_PAIRS");
- if(!pairs_string)
- {
- return;
- }
-
- // Convert the string to a list and preserve empty entries.
- std::vector<std::string> pairs;
- cmSystemTools::ExpandListArgument(pairs_string, pairs, true);
- for(std::vector<std::string>::const_iterator i = pairs.begin();
- i != pairs.end(); ++i)
- {
- const std::string& depender = *i;
- if(++i != pairs.end())
- {
- const std::string& dependee = *i;
-
- // If the depender is missing then delete the dependee to make
- // sure both will be regenerated.
- if(cmSystemTools::FileExists(dependee.c_str()) &&
- !cmSystemTools::FileExists(depender.c_str()))
- {
- if(verbose)
- {
- cmOStringStream msg;
- msg << "Deleting primary custom command output \"" << dependee
- << "\" because another output \""
- << depender << "\" does not exist." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
- }
- cmSystemTools::RemoveFile(dependee.c_str());
- }
- }
- }
}
void cmGlobalUnixMakefileGenerator3
@@ -763,21 +697,18 @@ cmGlobalUnixMakefileGenerator3
<< localName << "\n\n";
commands.clear();
- if (t->second.GetType() != cmTarget::UTILITY)
+ makeTargetName = localName;
+ makeTargetName += "/depend";
+ commands.push_back(lg->GetRecursiveMakeCall
+ (makefileName.c_str(),makeTargetName.c_str()));
+
+ // add requires if we need it for this generator
+ if (needRequiresStep)
{
makeTargetName = localName;
- makeTargetName += "/depend";
+ makeTargetName += "/requires";
commands.push_back(lg->GetRecursiveMakeCall
- (makefileName.c_str(),makeTargetName.c_str()));
-
- // add requires if we need it for this generator
- if (needRequiresStep)
- {
- makeTargetName = localName;
- makeTargetName += "/requires";
- commands.push_back(lg->GetRecursiveMakeCall
- (makefileName.c_str(),makeTargetName.c_str()));
- }
+ (makefileName.c_str(),makeTargetName.c_str()));
}
makeTargetName = localName;
makeTargetName += "/build";