1
0
Эх сурвалжийг харах

Generate java dependency files

Andy Cedilnik 23 жил өмнө
parent
commit
b35814d65e

+ 16 - 0
Source/cmVTKWrapJavaCommand.cxx

@@ -48,6 +48,15 @@ bool cmVTKWrapJavaCommand::InitialPass(std::vector<std::string> const& argsIn)
     sourceListValue = def;
     }
   
+  // Prepare java dependency file
+  std::string resultDirectory = "${VTK_JAVA_HOME}";
+  std::string res = m_Makefile->GetCurrentOutputDirectory();
+  std::string depFileName = res + "/JavaDependencies.cmake";
+  ofstream depFile(depFileName.c_str());
+  depFile << "# This file is automatically generated by CMake VTK_WRAP_JAVA" 
+          << std::endl << std::endl;
+  depFile << "SET(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES}" << std::endl;
+  
   // get the list of classes for this library
   for(std::vector<std::string>::const_iterator j = (args.begin() + 2);
       j != args.end(); ++j)
@@ -77,8 +86,15 @@ bool cmVTKWrapJavaCommand::InitialPass(std::vector<std::string> const& argsIn)
         sourceListValue += ";";
         }
       sourceListValue += newName + ".cxx";
+
+      // Write file to java dependency file
+      std::string jafaFile = resultDirectory + "/" + srcName + ".java";
+      depFile << "  " << jafaFile << std::endl;
       }
     }
+
+  // Finalize java dependency file
+  depFile << ")" << std::endl;
   
   m_Makefile->AddDefinition(m_SourceList.c_str(), sourceListValue.c_str());  
   return true;