diff options
author | Franck Bettinger <bettingf@cs.man.ac.uk> | 2001-11-16 14:01:57 (GMT) |
---|---|---|
committer | Franck Bettinger <bettingf@cs.man.ac.uk> | 2001-11-16 14:01:57 (GMT) |
commit | 9f9db7dad5b4461f9cd514748303d3e6b6d5627f (patch) | |
tree | e00b0fea3f65bf596c9bf6262fb9c70626fea415 | |
parent | 0d2f8e65c5e2a903eb78bf61dfd3e57a55ec1b32 (diff) | |
download | CMake-9f9db7dad5b4461f9cd514748303d3e6b6d5627f.zip CMake-9f9db7dad5b4461f9cd514748303d3e6b6d5627f.tar.gz CMake-9f9db7dad5b4461f9cd514748303d3e6b6d5627f.tar.bz2 |
corrected path problem and added moc compilation too
-rw-r--r-- | Source/cmQTWrapUICommand.cxx | 42 | ||||
-rw-r--r-- | Source/cmQTWrapUICommand.h | 1 |
2 files changed, 34 insertions, 9 deletions
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index a8d1a0c..608bbf3 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -95,29 +95,36 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args) { cmSourceFile header_file; cmSourceFile source_file; - header_file.SetIsAnAbstractClass(curr.IsAnAbstractClass()); - source_file.SetIsAnAbstractClass(curr.IsAnAbstractClass()); + cmSourceFile moc_file; header_file.SetName(curr.GetSourceName().c_str(), m_Makefile->GetCurrentOutputDirectory(), "h",false); source_file.SetName(curr.GetSourceName().c_str(), m_Makefile->GetCurrentOutputDirectory(), "cxx",false); + std::string moc_source_name("moc_"); + moc_source_name = moc_source_name + curr.GetSourceName().c_str(); + moc_file.SetName(moc_source_name.c_str(), + m_Makefile->GetCurrentOutputDirectory(), + "cxx",false); std::string origname = cdir + "/" + curr.GetSourceName() + "." + curr.GetSourceExtension(); - std::string hname = cdir + "/" + header_file.GetSourceName() + "." + - header_file.GetSourceExtension(); + std::string hname = header_file.GetFullPath(); m_WrapUserInterface.push_back(origname); // add starting depends + moc_file.GetDepends().push_back(hname); source_file.GetDepends().push_back(hname); source_file.GetDepends().push_back(origname); header_file.GetDepends().push_back(origname); m_WrapHeadersClasses.push_back(header_file); m_WrapSourcesClasses.push_back(source_file); + m_WrapMocClasses.push_back(moc_file); unsigned int last_files=m_WrapSourcesClasses.size()-1; - m_Makefile->AddSource(m_WrapHeadersClasses[last_files], + m_Makefile->AddSource(header_file, m_HeaderList.c_str()); - m_Makefile->AddSource(m_WrapSourcesClasses[last_files], + m_Makefile->AddSource(source_file, + m_SourceList.c_str()); + m_Makefile->AddSource(moc_file, m_SourceList.c_str()); } } @@ -133,6 +140,7 @@ void cmQTWrapUICommand::FinalPass() int lastHeadersClass = m_WrapHeadersClasses.size(); std::vector<std::string> depends; std::string uic_exe = "${QT_UIC_EXE}"; + std::string moc_exe = "${QT_MOC_EXE}"; // wrap all the .h files @@ -148,9 +156,8 @@ void cmQTWrapUICommand::FinalPass() for(int classNum = 0; classNum < lastHeadersClass; classNum++) { - // Add output to build list - // set up .ui to .h and .cxx command + std::string hres = m_Makefile->GetCurrentOutputDirectory(); hres += "/"; hres += m_WrapHeadersClasses[classNum].GetSourceName() + "." + @@ -161,7 +168,12 @@ void cmQTWrapUICommand::FinalPass() cxxres += m_WrapSourcesClasses[classNum].GetSourceName() + "." + m_WrapSourcesClasses[classNum].GetSourceExtension(); - ui_list = ui_list + " " + hres + " " + cxxres; + std::string mocres = m_Makefile->GetCurrentOutputDirectory(); + mocres += "/"; + mocres += m_WrapMocClasses[classNum].GetSourceName() + "." + + m_WrapMocClasses[classNum].GetSourceExtension(); + + ui_list = ui_list + " " + hres + " " + cxxres + " " + mocres; std::vector<std::string> hargs; hargs.push_back("-o"); @@ -175,6 +187,11 @@ void cmQTWrapUICommand::FinalPass() cxxargs.push_back(cxxres); cxxargs.push_back(m_WrapUserInterface[classNum]); + std::vector<std::string> mocargs; + mocargs.push_back("-o"); + mocargs.push_back(mocres); + mocargs.push_back(hres); + m_Makefile->AddCustomCommand(m_WrapUserInterface[classNum].c_str(), uic_exe.c_str(), hargs, depends, hres.c_str(), m_LibraryName.c_str()); @@ -185,6 +202,13 @@ void cmQTWrapUICommand::FinalPass() uic_exe.c_str(), cxxargs, depends, cxxres.c_str(), m_LibraryName.c_str()); + depends.clear(); + depends.push_back(moc_exe); + + m_Makefile->AddCustomCommand(hres.c_str(), + moc_exe.c_str(), mocargs, depends, + mocres.c_str(), m_LibraryName.c_str()); + } m_Makefile->AddDefinition("GENERATED_QT_FILES",ui_list.c_str()); diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 0daad14..3114972 100644 --- a/Source/cmQTWrapUICommand.h +++ b/Source/cmQTWrapUICommand.h @@ -69,6 +69,7 @@ private: */ std::vector<cmSourceFile> m_WrapSourcesClasses; std::vector<cmSourceFile> m_WrapHeadersClasses; + std::vector<cmSourceFile> m_WrapMocClasses; /** * List of header files that pprovide the source for m_WrapClasses. */ |