3 class myApp : public wxApp
7 int OnExit() { return true; }
11 CREA_WXMAIN_WITH_CONSOLE
17 //See http://www.wxwindows.org/faqgtk.htm#locale
18 setlocale(LC_NUMERIC, "C");
20 wxInitAllImageHandlers();
22 wxString dir = wxDirSelector(_T("Select directory in which to create the project"), _T(""), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
24 if (dir.IsEmpty()) return false;
26 wxString name = wxGetTextFromUser(_T("Enter project name"),
29 if (name.IsEmpty()) return false;
32 std::string command("creaNewProject.bat ");
33 std::string command1("creaSed.exe ");
34 std::string command2("del ");
36 command += "\"" + crea::wx2std(dir) + "\" \"" + crea::wx2std(name) + "\"";
37 command1 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\" " + "PROJECT_NAME " + crea::wx2std(name) + "> \"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt\"";
38 command2 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\"";
39 if ( ! system ( command.c_str() ) )
42 system ( command1.c_str() );
43 system ( command2.c_str() );
44 wxMessageBox(_T("Done !"),_T("creaNewProject"),
45 wxOK | wxICON_INFORMATION);
49 wxString err(_T("An error occured while running '"));
50 err += crea::std2wx(command) + _T("'");
51 wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);
54 std::string command("creaNewProject.sh ");
55 command += "\"" + crea::wx2std(dir) + "\"" +" " + crea::wx2std(name);
56 if ( ! system ( command.c_str() ) )
58 wxMessageBox(_T("Done !"),_T("creaNewProject"),
59 wxOK | wxICON_INFORMATION);
63 wxString err(_T("An error occured while running '"));
64 err += crea::std2wx(command) + _T("'");
65 wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);
69 command += "\"" + crea::wx2std(dir) + "\" \"" + crea::wx2std(name) + "\"";
70 command1 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\" " + "PROJECT_NAME " + crea::wx2std(name) + "> \"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt\"";
71 command2 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\"";
72 if ( ! system ( command.c_str() ) )
75 system ( command1.c_str() );
76 system ( command2.c_str() );
77 wxMessageBox(_T("Done !"),_T("creaNewProject"),
78 wxOK | wxICON_INFORMATION);
82 wxString err(_T("An error occured while running '"));
83 err += crea::std2wx(command) + _T("'");
84 wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);