summaryrefslogtreecommitdiffstats
path: root/Source/cmQTWrapCPPCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
commit39af9ee1e496db77849015541f687897ed819a56 (patch)
tree79bd7c1765408c80822dc9b87853bdac24704332 /Source/cmQTWrapCPPCommand.cxx
parent4d30cb309cc0cd191e89a7969599b79dea111a08 (diff)
downloadCMake-39af9ee1e496db77849015541f687897ed819a56.zip
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.gz
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.bz2
ENH: Updated implementation of custom commands. Multiple command lines are now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues.
Diffstat (limited to 'Source/cmQTWrapCPPCommand.cxx')
-rw-r--r--Source/cmQTWrapCPPCommand.cxx43
1 files changed, 15 insertions, 28 deletions
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index 9f74a71..edf215a 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -99,19 +99,11 @@ void cmQTWrapCPPCommand::FinalPass()
// first we add the rules for all the .h to Moc files
size_t lastClass = m_WrapClasses.size();
std::vector<std::string> depends;
- std::string moc_exe = "${QT_MOC_EXECUTABLE}";
+ const char* moc_exe = m_Makefile->GetRequiredDefinition("QT_MOC_EXECUTABLE");
// wrap all the .h files
depends.push_back(moc_exe);
- const char * GENERATED_QT_FILES_value=
- m_Makefile->GetDefinition("GENERATED_QT_FILES");
- std::string moc_list("");
- if (GENERATED_QT_FILES_value!=0)
- {
- moc_list=moc_list+GENERATED_QT_FILES_value;
- }
-
for(size_t classNum = 0; classNum < lastClass; classNum++)
{
// Add output to build list
@@ -122,28 +114,23 @@ void cmQTWrapCPPCommand::FinalPass()
res += "/";
res += m_WrapClasses[classNum].GetSourceName() + ".cxx";
- moc_list = moc_list + " " + res;
-
- std::vector<std::string> args;
- args.push_back("-o");
- args.push_back(res);
- args.push_back(m_WrapHeaders[classNum]);
+ cmCustomCommandLine commandLine;
+ commandLine.push_back(moc_exe);
+ commandLine.push_back("-o");
+ commandLine.push_back(res);
+ commandLine.push_back(m_WrapHeaders[classNum]);
+
+ cmCustomCommandLines commandLines;
+ commandLines.push_back(commandLine);
std::vector<std::string> realdepends = depends;
realdepends.push_back(m_WrapHeaders[classNum]);
- m_Makefile->AddCustomCommandToOutput(
- res.c_str(),
- moc_exe.c_str(),
- args,
- 0,
- realdepends,
- "QT Wrapped File",
- 0);
+ const char* no_main_dependency = 0;
+ m_Makefile->AddCustomCommandToOutput(res.c_str(),
+ realdepends,
+ no_main_dependency,
+ commandLines,
+ "QT Wrapped File");
}
-
- m_Makefile->AddDefinition("GENERATED_QT_FILES",moc_list.c_str());
}
-
-
-