3 #include <stdlib.h> // for getenv
5 class myApp : public wxApp
9 int OnExit() { return true; }
13 CREA_WXMAIN_WITH_CONSOLE
19 //See http://www.wxwindows.org/faqgtk.htm#locale
20 setlocale(LC_NUMERIC, "C");
22 wxInitAllImageHandlers();
24 wxString dir = wxDirSelector(_T("Select directory in which to create the project"), _T(""), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
26 if (dir.IsEmpty()) return false;
28 wxString name = wxGetTextFromUser(_T("Enter project name"),
31 if (name.IsEmpty()) return false;
33 char * install_Dir = getenv("bbtk_DIR");
34 std::string execGUICreateNewPackage(install_Dir);
35 execGUICreateNewPackage = "bbi " + execGUICreateNewPackage;
38 std::string command("creaNewProject.bat ");
39 std::string command1("creaSed.exe ");
40 std::string command2("del ");
42 command += "\"" + crea::wx2std(dir) + "\" \"" + crea::wx2std(name) + "\"";
43 command1 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\" " + "NameOfTheProject " + crea::wx2std(name) + "> \"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt\"";
44 command2 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\"";
45 if ( ! system ( command.c_str() ) )
47 system ( command1.c_str() );
48 system ( command2.c_str() );
49 wxMessageBox(_T("Done !"),_T("creaNewProject"),
50 wxOK | wxICON_INFORMATION);
51 // Create a Package at the same time. JPR
52 execGUICreateNewPackage += "\..\..\..\share\bbtk\bbs\toolsbbtk\appli\GUICreatePackage.bbs";
53 system(execGUICreateNewPackage.c_str());
57 wxString err(_T("An error occured while running '"));
58 err += crea::std2wx(command) + _T("'");
59 wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);
62 std::string command("creaNewProject.sh ");
63 command += "\"" + crea::wx2std(dir) + "\"" +" " + crea::wx2std(name);
64 if ( ! system ( command.c_str() ) )
66 wxMessageBox(_T("Done !"),_T("creaNewProject"),
67 wxOK | wxICON_INFORMATION);
68 // Create a Package at the same time. JPR
69 execGUICreateNewPackage += "/../../../share/bbtk/bbs/toolsbbtk/appli/GUICreatePackage.bbs";
70 system(execGUICreateNewPackage.c_str());
75 wxString err(_T("An error occured while running '"));
76 err += crea::std2wx(command) + _T("'");
77 wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);