Browse Source

FIX: The command was modified it uses now a target and a source list
composed of .fl files. The names of the generated .cxx files are
added internally to the Sources list of the target.

Luis Ibanez 24 years ago
parent
commit
cdecad7a05
2 changed files with 9 additions and 17 deletions
  1. 8 16
      Source/cmFLTKWrapUICommand.cxx
  2. 1 1
      Source/cmFLTKWrapUICommand.h

+ 8 - 16
Source/cmFLTKWrapUICommand.cxx

@@ -77,9 +77,9 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
   // what is the current source dir
   std::string cdir = m_Makefile->GetCurrentDirectory();
 
-  // keep the library name
-  m_GUISourceList       = args[0];  // Source List of the GUI source files 
-  m_GeneratedSourceList = args[1];  // Source List to insert the generated .cxx files
+  // 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 
 
   cmMakefile::SourceMap &GUISources = m_Makefile->GetSources();
  
@@ -122,17 +122,6 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
       m_GeneratedHeadersClasses.push_back(header_file);
       m_GeneratedSourcesClasses.push_back(source_file);
 
-      m_Makefile->AddSource(header_file, m_GeneratedSourceList.c_str());
-      m_Makefile->AddSource(source_file, m_GeneratedSourceList.c_str());
-
-      m_Makefile->AddSource(header_file, m_GeneratedSourceList.c_str());
-      m_Makefile->AddSource(source_file, m_GeneratedSourceList.c_str());
-
-      cmTarget cxxtarget;
-      cxxtarget.SetType( cmTarget::GENERATED_CODE );
-      cmTargets::value_type cxxpair( cxxname, cxxtarget );
-      m_Makefile->GetTargets().insert( cxxpair );
-
       }
     }
   
@@ -177,10 +166,13 @@ void cmFLTKWrapUICommand::FinalPass()
     outputs.push_back( cxxres );
     outputs.push_back( hres   );
      
-    // Add command for generating the .h file
+    // Add command for generating the .h and .cxx files
     m_Makefile->AddCustomCommand(m_WrapUserInterface[classNum].c_str(),
                                  fluid_exe.c_str(), cxxargs, depends, 
-                                 outputs, cxxres.c_str() );
+                                 outputs, m_Target.c_str() );
+    
+    m_Makefile->GetTargets()[m_Target].GetSourceFiles().push_back( m_GeneratedSourcesClasses[classNum] );
+        
     }
 }
 

+ 1 - 1
Source/cmFLTKWrapUICommand.h

@@ -73,8 +73,8 @@ private:
    * generating .cxx and .h files
    */
   std::vector<std::string> m_WrapUserInterface;
+  std::string m_Target;
   std::string m_GUISourceList;
-  std::string m_GeneratedSourceList;
 };