summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-07-14 09:31:29 -0400
committerKen Martin <ken.martin@kitware.com>2003-07-14 09:31:29 -0400
commiteacc8da7e5792194788ea91f7518cfc09f60571d (patch)
tree17bcfbe8f5e48a9e4afd6d2266d98084b9e819cc
parent274535d36642e5615a3b8b1d098396759a9e09f9 (diff)
downloadcmake-eacc8da7e5792194788ea91f7518cfc09f60571d.tar.gz
some updates
-rw-r--r--Source/cmFLTKWrapUICommand.cxx76
-rw-r--r--Source/cmFLTKWrapUICommand.h6
2 files changed, 34 insertions, 48 deletions
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index aa098d955d..b6925520ac 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -43,10 +43,10 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
// what is the current source dir
std::string cdir = m_Makefile->GetCurrentDirectory();
+ std::string fluid_exe = "${FLTK_FLUID_EXECUTABLE}";
// get parameter for the command
m_Target = args[0]; // Target that will use the generated files
- m_GUISourceList = args[1]; // Source List of the GUI source files
std::vector<std::string> newArgs;
m_Makefile->ExpandSourceListArguments(args,newArgs, 1);
@@ -76,13 +76,37 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
outputDirectory.c_str(), "cxx",!headerFileOnly);
std::string origname = cdir + "/" + *i;
std::string hname = header_file.GetFullPath();
- m_WrapUserInterface.push_back(origname);
// add starting depends
source_file.GetDepends().push_back(hname);
+ std::vector<std::string> depends;
+ depends.push_back(origname);
source_file.GetDepends().push_back(origname);
- header_file.GetDepends().push_back(origname);
- m_GeneratedHeadersClasses.push_back(header_file);
- m_GeneratedSourcesClasses.push_back(source_file);
+
+ const char *cxxres = source_file.GetFullPath().c_str();
+
+ 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(hname);
+ cxxargs.push_back("-o"); // optionally rename .cxx files
+ cxxargs.push_back(cxxres);
+ cxxargs.push_back(origname);// name of the GUI fluid file
+
+ // Add command for generating the .h and .cxx files
+ m_Makefile->AddCustomCommandToOutput(cxxres,
+ fluid_exe.c_str(),
+ cxxargs,
+ 0,
+ depends);
+
+ m_Makefile->AddCustomCommandToOutput(hname.c_str(),
+ fluid_exe.c_str(),
+ cxxargs,
+ 0,
+ depends);
+
+ cmSourceFile* sf = m_Makefile->AddSource(source_file);
+ m_GeneratedSourcesClasses.push_back(sf);
}
}
@@ -91,50 +115,14 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
void cmFLTKWrapUICommand::FinalPass()
{
-
// first we add the rules for all the .fl to .h and .cxx files
- size_t lastHeadersClass = m_GeneratedHeadersClasses.size();
- std::string fluid_exe = "${FLTK_FLUID_EXECUTABLE}";
-
-
- std::string outputGUIDirectory = m_Makefile->GetCurrentOutputDirectory();
+ size_t lastHeadersClass = m_GeneratedSourcesClasses.size();
// Generate code for all the .fl files
for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
{
- // set up .fl to .h and .cxx command
- std::string hres = outputGUIDirectory;
- hres += "/";
- hres += m_GeneratedHeadersClasses[classNum].GetSourceName() + "." +
- m_GeneratedHeadersClasses[classNum].GetSourceExtension();
-
- std::string cxxres = outputGUIDirectory;
- cxxres += "/";
- cxxres += m_GeneratedSourcesClasses[classNum].GetSourceName() + "." +
- m_GeneratedSourcesClasses[classNum].GetSourceExtension();
-
- 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]);// name of the GUI fluid file
-
- std::vector<std::string> depends;
-
- std::vector<std::string> outputs;
- outputs.push_back( cxxres );
- outputs.push_back( hres );
-
- // Add command for generating the .h and .cxx files
- m_Makefile->AddCustomCommand(m_WrapUserInterface[classNum].c_str(),
- fluid_exe.c_str(), cxxargs, depends,
- outputs, m_Target.c_str() );
- cmSourceFile* sf = m_Makefile->AddSource(m_GeneratedSourcesClasses[classNum]);
-
- m_Makefile->GetTargets()[m_Target].GetSourceFiles().push_back( sf );
-
+ m_Makefile->GetTargets()[m_Target].GetSourceFiles().push_back(
+ m_GeneratedSourcesClasses[classNum]);
}
}
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index 1c738ee9f3..4b13006008 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -80,15 +80,13 @@ private:
/**
* List of produced files.
*/
- std::vector<cmSourceFile> m_GeneratedSourcesClasses;
- std::vector<cmSourceFile> m_GeneratedHeadersClasses;
+ std::vector<cmSourceFile *> m_GeneratedSourcesClasses;
+
/**
* List of Fluid files that provide the source
* generating .cxx and .h files
*/
- std::vector<std::string> m_WrapUserInterface;
std::string m_Target;
- std::string m_GUISourceList;
};