diff options
author | Luis Ibanez <luis.ibanez@kitware.com> | 2001-11-29 06:46:29 (GMT) |
---|---|---|
committer | Luis Ibanez <luis.ibanez@kitware.com> | 2001-11-29 06:46:29 (GMT) |
commit | e11df329312174ca3d89bf85719091616a269ea5 (patch) | |
tree | 6893bf99a188c4facd8673926da76176fdb2c8a0 | |
parent | e7bb895afda0ccc5711906873040459942137dce (diff) | |
download | CMake-e11df329312174ca3d89bf85719091616a269ea5.zip CMake-e11df329312174ca3d89bf85719091616a269ea5.tar.gz CMake-e11df329312174ca3d89bf85719091616a269ea5.tar.bz2 |
ENH: Custom commands are now builded.
-rw-r--r-- | Source/cmFLTKWrapUICommand.cxx | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 05bb453..5912357 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -44,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // cmFLTKWrapUICommand bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args) { - std::cout << "args.size()=" << args.size() << std::endl; if(args.size() < 2 ) { this->SetError("called with incorrect number of arguments"); @@ -100,7 +99,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args) "cxx",false); std::string origname = cdir + "/" + curr.GetSourceName() + "." + curr.GetSourceExtension(); - std::string hname = header_file.GetFullPath(); + std::string hname = header_file.GetFullPath(); + std::string cxxname = source_file.GetFullPath(); m_WrapUserInterface.push_back(origname); // add starting depends source_file.GetDepends().push_back(hname); @@ -110,6 +110,19 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args) m_GeneratedSourcesClasses.push_back(source_file); m_Makefile->AddSource(source_file, m_GeneratedSourceList.c_str()); + + cmTarget htarget; + htarget.SetType( cmTarget::GENERATED_CODE ); + cmTargets::value_type hpair( hname, htarget ); + m_Makefile->GetTargets().insert( hpair ); + + cmTarget cxxtarget; + cxxtarget.SetType( cmTarget::GENERATED_CODE ); + cmTargets::value_type cxxpair( cxxname, cxxtarget ); + m_Makefile->GetTargets().insert( cxxpair ); + + + } } @@ -125,17 +138,7 @@ void cmFLTKWrapUICommand::FinalPass() std::string fluid_exe = "${FLTK_FLUID_EXE}"; - // wrap all the .h files - depends.push_back(fluid_exe); - - const char * FLUID_GENERATED_FILES_value= - m_Makefile->GetDefinition("FLUID_GENERATED_FILES"); - std::string ui_list(""); - if (FLUID_GENERATED_FILES_value!=0) - { - ui_list=ui_list+FLUID_GENERATED_FILES_value; - } - + // Generate code for all the .fl files for(int classNum = 0; classNum < lastHeadersClass; classNum++) { // set up .fl to .h and .cxx command @@ -149,24 +152,29 @@ void cmFLTKWrapUICommand::FinalPass() cxxres += m_GeneratedSourcesClasses[classNum].GetSourceName() + "." + m_GeneratedSourcesClasses[classNum].GetSourceExtension(); - ui_list = ui_list + " " + hres + " " + cxxres; - std::vector<std::string> cxxargs; + cxxargs.push_back("-c"); // instructs Fluid to run in command line cxxargs.push_back("-h"); // optionally rename .h files cxxargs.push_back(hres); cxxargs.push_back("-o"); // optionally rename .cxx files cxxargs.push_back(cxxres); - cxxargs.push_back(m_WrapUserInterface[classNum]); + cxxargs.push_back(m_WrapUserInterface[classNum]);// name of the GUI fluid file depends.push_back(hres); + // Add command for generating the .h file m_Makefile->AddCustomCommand(m_WrapUserInterface[classNum].c_str(), fluid_exe.c_str(), cxxargs, depends, - cxxres.c_str(), m_GeneratedSourceList.c_str()); + cxxres.c_str(), hres.c_str() ); - } - m_Makefile->AddDefinition("FLUID_GENERATED_FILES",ui_list.c_str()); + // Add command for generating the .cxx file + m_Makefile->AddCustomCommand(m_WrapUserInterface[classNum].c_str(), + fluid_exe.c_str(), cxxargs, depends, + cxxres.c_str(), cxxres.c_str() ); + + + } } |