]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMApplication.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMApplication.cpp
index 40fb8105b12dbb270f7e2704eb9cd5e7f95a7622..dcfb21e84ff0d86df300b3964e0183dff3946e92 100644 (file)
@@ -140,7 +140,7 @@ modelCDMApplication::modelCDMApplication(modelCDMIProjectTreeNode* parent, const
                       std::getline(fileStream,word,'(');
                       std::vector<std::string> wordBits;
                       CDMUtilities::splitter::split(wordBits,word," \n",CDMUtilities::splitter::no_empties);
-                      if (wordBits[wordBits.size() - 1] == "main")
+                      if (wordBits[wordBits.size() - 1] == "main" || wordBits[wordBits.size() - 1] == "IMPLEMENT_APP")
                         {
                           this->mainFile = file;
                         }
@@ -206,7 +206,12 @@ bool modelCDMApplication::SetExecutableName(const std::string& fileName, std::st
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + this->path + CDMUtilities::SLASH + "CMakeLists.txt.tmp\" \"" + this->path + CDMUtilities::SLASH + "CMakeLists.txt\"";
+#else
   std::string renameCommand = "mv \"" + this->path + CDMUtilities::SLASH + "CMakeLists.txt.tmp\" \"" + this->path + CDMUtilities::SLASH + "CMakeLists.txt\"";
+#endif
+  
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");