1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Generate sample VC++ project files
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "makeproj.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
19 #if defined(__BORLANDC__)
24 #include "wx/resource.h"
30 #include "projgenrc.h"
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
35 // the application icon
36 #if defined(__WXGTK__) || defined(__WXMOTIF__)
37 #include "mondrian.xpm"
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 // Define a new application type, each program should derive a class from wxApp
45 class MyApp
: public wxApp
48 // override base class virtuals
49 // ----------------------------
51 // this one is called on application startup and is a good place for the app
52 // initialization (doing it here and not in the ctor allows to have an error
53 // return: if OnInit() returns false, the application terminates)
54 virtual bool OnInit();
56 bool GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
57 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
= "../..");
58 void GenerateSamples(const wxString
& dir
); // Takes wxWindows directory path
61 // Define a new frame type: this is going to be our main frame
62 class MyFrame
: public wxFrame
66 MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
68 // event handlers (these functions should _not_ be virtual)
69 void OnQuit(wxCommandEvent
& event
);
70 void OnAbout(wxCommandEvent
& event
);
71 void OnGenerate(wxCommandEvent
& event
);
73 bool GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
74 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
= "../..");
77 // any class wishing to process wxWindows events must use this macro
81 // Define a dialog: this will be our main dialog
82 class MyDialog
: public wxDialog
86 MyDialog(const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
);
88 // event handlers (these functions should _not_ be virtual)
89 void OnQuit(wxCommandEvent
& event
);
90 void OnAbout(wxCommandEvent
& event
);
91 void OnGenerate(wxCommandEvent
& event
);
92 void OnGenerateSamples(wxCommandEvent
& event
);
95 // any class wishing to process wxWindows events must use this macro
100 // ----------------------------------------------------------------------------
102 // ----------------------------------------------------------------------------
104 // IDs for the controls and the menu commands
108 MakeProject_Quit
= 1,
110 MakeProject_Generate
,
111 MakeProject_GenerateSamples
,
113 // controls start here (the numbers are, of course, arbitrary)
114 MakeProject_Text
= 1000,
117 // ----------------------------------------------------------------------------
118 // event tables and other macros for wxWindows
119 // ----------------------------------------------------------------------------
121 // the event tables connect the wxWindows events with the functions (event
122 // handlers) which process them. It can be also done at run-time, but for the
123 // simple menu events like this the static method is much simpler.
124 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
125 EVT_MENU(MakeProject_Quit
, MyFrame::OnQuit
)
126 EVT_MENU(MakeProject_About
, MyFrame::OnAbout
)
127 EVT_MENU(MakeProject_Generate
, MyFrame::OnGenerate
)
130 // Create a new application object: this macro will allow wxWindows to create
131 // the application object during program execution (it's better than using a
132 // static object for many reasons) and also declares the accessor function
133 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
137 // ============================================================================
139 // ============================================================================
141 // ----------------------------------------------------------------------------
142 // the application class
143 // ----------------------------------------------------------------------------
145 // 'Main program' equivalent: the program execution "starts" here
149 // Create the main application window
150 MyFrame
*frame
= new MyFrame("MakeProject wxWindows App",
151 wxPoint(50, 50), wxSize(450, 340));
156 wxResourceParseFile("projgenrc.wxr");
158 MyDialog
* dialog
= new MyDialog("VC++ MakeProject");
164 bool MyApp::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
165 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
)
167 wxString
relativeIncludePath(relativeRootPath
+ wxString("/include"));
168 wxString
relativeLibPath(relativeRootPath
+ wxString("/lib"));
169 wxString
relativeDebugPath(relativeRootPath
+ wxString("/src/Debug"));
170 wxString
relativeReleasePath(relativeRootPath
+ wxString("/src/Release"));
171 wxString
relativeDebugPathJPEG(relativeRootPath
+ wxString("/src/jpeg/Debug"));
172 wxString
relativeReleasePathJPEG(relativeRootPath
+ wxString("/src/jpeg/Release"));
173 wxString
relativeDebugPathTIFF(relativeRootPath
+ wxString("/src/tiff/Debug"));
174 wxString
relativeReleasePathTIFF(relativeRootPath
+ wxString("/src/tiff/Release"));
179 project
.SetIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
180 project
.SetResourceIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
181 project
.SetLibDirs(wxStringList((const char*) relativeLibPath
, 0));
182 project
.SetDebugLibDirs(wxStringList((const char*) relativeDebugPath
, (const char*) relativeDebugPathJPEG
, (const char*) relativeDebugPathTIFF
, 0));
183 project
.SetReleaseLibDirs(wxStringList((const char*) relativeReleasePath
, (const char*) relativeReleasePathJPEG
, (const char*) relativeReleasePathTIFF
, 0));
185 project
.SetProjectName(projectName
);
186 project
.SetTargetName(targetName
);
187 project
.SetProjectPath(path
);
188 project
.SetSourceFiles(sourceFiles
);
190 if (!project
.GenerateVCProject())
192 wxString
msg("Could not generate ");
201 void MyApp::GenerateSamples(const wxString
& dir
)
203 // Small bug. Because we don't distinguish between Debug/DebugDLL, Release/ReleaseDLL,
204 // we can't yet make a sample that uses other wxWindows static libraries + the wxWindows DLL library.
208 GenerateSample("CalendarVC", "calendar", dir
+ wxString("/samples/calendar"), wxStringList("calendar.cpp", 0));
209 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
210 GenerateSample("CheckLstVC", "checklst", dir
+ wxString("/samples/checklst"), wxStringList("checklst.cpp", 0));
211 GenerateSample("ConfigVC", "conftest", dir
+ wxString("/samples/config"), wxStringList("conftest.cpp", 0));
212 GenerateSample("ControlsVC", "controls", dir
+ wxString("/samples/controls"), wxStringList("controls.cpp", 0));
213 GenerateSample("DbVC", "dbtest", dir
+ wxString("/samples/db"),
214 wxStringList("dbtest.cpp", "listdb.cpp", "dbtest.h", "listdb.h", 0));
215 GenerateSample("DialogsVC", "dialogs", dir
+ wxString("/samples/dialogs"),
216 wxStringList("dialogs.cpp", "dialogs.h", 0));
217 GenerateSample("DndVC", "dnd", dir
+ wxString("/samples/dnd"), wxStringList("dnd.cpp", 0));
218 GenerateSample("DocViewVC", "docview", dir
+ wxString("/samples/docview"),
219 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
220 GenerateSample("DocVwMDIVC", "docview", dir
+ wxString("/samples/docvwmdi"),
221 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
222 GenerateSample("DynamicVC", "dynamic", dir
+ wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
223 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
224 GenerateSample("ExecVC", "exec", dir
+ wxString("/samples/exec"), wxStringList("exec.cpp", 0));
225 GenerateSample("GridVC", "test", dir
+ wxString("/samples/grid"), wxStringList("test.cpp", 0));
226 GenerateSample("NewGridVC", "griddemo", dir
+ wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
227 GenerateSample("HelpVC", "demo", dir
+ wxString("/samples/help"), wxStringList("demo.cpp", 0));
230 GenerateSample("AboutVC", "about", dir
+ wxString("/samples/html/about"), wxStringList("about.cpp", 0),
232 GenerateSample("HelpVC", "help", dir
+ wxString("/samples/html/help"), wxStringList("help.cpp", 0),
234 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/html/printing"), wxStringList("printing.cpp", 0),
236 GenerateSample("TestVC", "test", dir
+ wxString("/samples/html/test"), wxStringList("test.cpp", 0),
238 GenerateSample("VirtualVC", "virtual", dir
+ wxString("/samples/html/virtual"), wxStringList("virtual.cpp", 0),
240 GenerateSample("WidgetVC", "widget", dir
+ wxString("/samples/html/widget"), wxStringList("widget.cpp", 0),
242 GenerateSample("ZipVC", "zip", dir
+ wxString("/samples/html/zip"), wxStringList("zip.cpp", 0),
244 GenerateSample("HelpViewVC", "helpview", dir
+ wxString("/samples/html/helpview"), wxStringList("helpview.cpp", 0),
247 GenerateSample("ImageVC", "image", dir
+ wxString("/samples/image"), wxStringList("image.cpp", 0));
248 GenerateSample("InternatVC", "internat", dir
+ wxString("/samples/internat"), wxStringList("internat.cpp", 0));
249 GenerateSample("JoytestVC", "joytest", dir
+ wxString("/samples/joytest"), wxStringList("joytest.cpp", "joytest.h", 0));
250 GenerateSample("LayoutVC", "layout", dir
+ wxString("/samples/layout"), wxStringList("layout.cpp", "layout.h", 0));
251 GenerateSample("ListctrlVC", "listtest", dir
+ wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
252 GenerateSample("MdiVC", "mdi", dir
+ wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
253 GenerateSample("MemcheckVC", "memcheck", dir
+ wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
254 // Note: MFC sample will be different.
255 GenerateSample("MfcVC", "mfc", dir
+ wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
256 GenerateSample("MiniframVC", "test", dir
+ wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
257 GenerateSample("MinimalVC", "minimal", dir
+ wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
258 GenerateSample("NativdlgVC", "nativdlg", dir
+ wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
259 GenerateSample("DialupVC", "nettest", dir
+ wxString("/samples/dialup"), wxStringList("nettest.cpp", 0));
260 GenerateSample("NotebookVC", "test", dir
+ wxString("/samples/notebook"), wxStringList("test.cpp", "test.h", 0));
261 GenerateSample("OleautoVC", "oleauto", dir
+ wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
262 GenerateSample("OwnerdrwVC", "ownerdrw", dir
+ wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
263 GenerateSample("PngVC", "pngdemo", dir
+ wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
264 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
265 GenerateSample("ProplistVC", "test", dir
+ wxString("/samples/proplist"), wxStringList("test.cpp", "test.h", 0));
266 GenerateSample("RegtestVC", "regtest", dir
+ wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
267 GenerateSample("ResourceVC", "resource", dir
+ wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
268 GenerateSample("RichEditVC", "wxLayout", dir
+ wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
269 "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
270 GenerateSample("SashtestVC", "sashtest", dir
+ wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
271 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
272 GenerateSample("SplitterVC", "test", dir
+ wxString("/samples/splitter"), wxStringList("test.cpp", 0));
273 GenerateSample("TabVC", "test", dir
+ wxString("/samples/tab"), wxStringList("test.cpp", "test.h", 0));
274 GenerateSample("TaskbarVC", "tbtest", dir
+ wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
275 GenerateSample("TextVC", "text", dir
+ wxString("/samples/text"), wxStringList("text.cpp", 0));
276 GenerateSample("ThreadVC", "test", dir
+ wxString("/samples/thread"), wxStringList("test.cpp", 0));
277 GenerateSample("ToolbarVC", "test", dir
+ wxString("/samples/toolbar"), wxStringList("test.cpp", "test.h", 0));
278 GenerateSample("TreectrlVC", "treetest", dir
+ wxString("/samples/treectrl"), wxStringList("treetest.cpp", "treetest.h", 0));
279 GenerateSample("TypetestVC", "typetest", dir
+ wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
280 GenerateSample("ValidateVC", "validate", dir
+ wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
281 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/socket"), wxStringList("client.cpp", 0));
282 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/socket"), wxStringList("server.cpp", 0));
283 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/dde"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
284 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/dde"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
285 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
286 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
287 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
288 GenerateSample("WizardVC", "wizard", dir
+ wxString("/samples/wizard"), wxStringList("wiztest.cpp", 0));
292 GenerateSample("BombsVC", "bombs", dir
+ wxString("/demos/bombs"),
293 wxStringList("bombs.cpp", "bombs1.cpp", "game.cpp", "bombs.h", "game.h", 0));
295 GenerateSample("FortyVC", "forty", dir
+ wxString("/demos/forty"),
296 wxStringList("forty.cpp", "canvas.cpp", "card.cpp", "game.cpp", "pile.cpp", "playerdg.cpp", "scoredg.cpp", "scorefil.cpp",
297 "canvas.h", "forty.h", "card.h", "game.h", "pile.h", "playerdg.h", "scoredg.h", "scorefil.h",
300 GenerateSample("FractalVC", "fractal", dir
+ wxString("/demos/fractal"), wxStringList("fractal.cpp", 0));
302 GenerateSample("LifeVC", "life", dir
+ wxString("/demos/life"),
303 wxStringList("life.cpp", "game.cpp", "dialogs.cpp", "life.h", "game.h", "dialogs.h", 0));
305 GenerateSample("PoemVC", "wxpoem", dir
+ wxString("/demos/poem"), wxStringList("wxpoem.cpp", "wxpoem.h", 0));
307 GenerateSample("DbbrowseVC", "dbbrowse", dir
+ wxString("/demos/dbbrowse"),
308 wxStringList("dbbrowse.cpp", "browsedb.cpp", "dbgrid.cpp", "dbtree.cpp", "dlguser.cpp", "doc.cpp",
309 "pgmctrl.cpp", "tabpgwin.cpp",
310 "dbbrowse.h", "browsedb.h", "dbgrid.h", "dbtree.h", "dlguser.h", "doc.h", "pgmctrl.h", "std.h", "tabpgwin.h",
318 project
.SetIncludeDirs(wxStringList("../../../include", 0));
319 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
320 project
.SetLibDirs(wxStringList("../../../lib", 0));
321 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
322 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
324 project
.SetProjectName("DialogEdVC");
325 project
.SetTargetName("dialoged");
326 project
.SetProjectPath(dir
+ wxString("/utils/dialoged/src"));
327 project
.SetSourceFiles(wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
328 "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
329 "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
333 if (!project
.GenerateVCProject())
335 wxString
msg("Could not generate Dialog Editor project");
340 project
.SetIncludeDirs(wxStringList("../../../include", 0));
341 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
342 project
.SetLibDirs(wxStringList("../../../lib", 0));
343 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
344 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
346 project
.SetProjectName("Tex2RTFVC");
347 project
.SetTargetName("tex2rtf");
348 project
.SetProjectPath(dir
+ wxString("/utils/tex2rtf/src"));
349 project
.SetSourceFiles(wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
350 "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
351 "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
354 if (!project
.GenerateVCProject())
356 wxString
msg("Could not generate Tex2RTF project");
361 project
.SetIncludeDirs(wxStringList("../../../include", 0));
362 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
363 project
.SetLibDirs(wxStringList("../../../lib", 0));
364 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
365 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
367 project
.SetProjectName("HelpGenVC");
368 project
.SetTargetName("helpgen");
369 project
.SetProjectPath(dir
+ wxString("/utils/helpgen/src"));
370 project
.SetSourceFiles(wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
371 "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
373 "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
374 "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0));
376 if (!project
.GenerateVCProject())
378 wxString
msg("Could not generate HelpGen project");
383 project
.SetIncludeDirs(wxStringList("../../include", 0));
384 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
385 project
.SetLibDirs(wxStringList("../../lib", 0));
386 project
.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
387 project
.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
389 project
.SetProjectName("ProjGenVC");
390 project
.SetTargetName("makeproj");
391 project
.SetProjectPath(dir
+ wxString("/utils/projgen"));
392 project
.SetSourceFiles(wxStringList("makeproj.cpp", "makeproj.h", 0));
394 if (!project
.GenerateVCProject())
396 wxString
msg("Could not generate ProjGen project");
401 project
.SetIncludeDirs(wxStringList("../../include", 0));
402 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
403 project
.SetLibDirs(wxStringList("../../lib", 0));
404 project
.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
405 project
.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
407 project
.SetProjectName("hhp2cachedVC");
408 project
.SetTargetName("hhp2cached");
409 project
.SetProjectPath(dir
+ wxString("/utils/hhp2cached"));
410 project
.SetSourceFiles(wxStringList("hhp2cached.cpp", 0));
412 if (!project
.GenerateVCProject())
414 wxString
msg("Could not generate hhp2cached project");
418 // wxTreeLayout sample
420 project
.SetIncludeDirs(wxStringList("../../../include", 0));
421 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
422 project
.SetLibDirs(wxStringList("../../../lib", 0));
423 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
424 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
426 project
.SetProjectName("TreeSampleVC");
427 project
.SetTargetName("test");
428 project
.SetProjectPath(dir
+ wxString("/utils/wxtree/src"));
429 project
.SetSourceFiles(wxStringList("test.cpp", "wxtree.cpp", "test.h", "wxtree.h", 0));
431 if (!project
.GenerateVCProject())
433 wxString
msg("Could not generate wxTreeLayout project");
439 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
440 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
441 project
.SetLibDirs(wxStringList("../../../../lib", 0));
442 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
443 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
445 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
447 project
.SetProjectName("OGLEditVC");
448 project
.SetTargetName("ogledit");
449 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/ogledit"));
450 project
.SetSourceFiles(wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
451 "doc.h", "ogledit.h", "palette.h", "view.h",
454 if (!project
.GenerateVCProject())
456 wxString
msg("Could not generate OGLEdit project");
462 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
463 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
464 project
.SetLibDirs(wxStringList("../../../../lib", 0));
465 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
466 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
467 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
469 project
.SetProjectName("StudioVC");
470 project
.SetTargetName("studio");
471 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/studio"));
472 project
.SetSourceFiles(wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
473 "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
474 "studio.h", "cspalette.h", "dialogs.h", "view.h",
475 "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h",
478 if (!project
.GenerateVCProject())
480 wxString
msg("Could not generate OGL Studio project");
484 // GLCanvas cube sample
486 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
487 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
488 project
.SetLibDirs(wxStringList("../../../../lib", 0));
489 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
490 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
492 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
494 project
.SetProjectName("CubeVC");
495 project
.SetTargetName("cube");
496 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/cube"));
497 project
.SetSourceFiles(wxStringList("cube.cpp", "cube.h",
500 if (!project
.GenerateVCProject())
502 wxString
msg("Could not generate GLCanvas Cube project");
506 // GLCanvas isosurf sample
508 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
509 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
510 project
.SetLibDirs(wxStringList("../../../../lib", 0));
511 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
512 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
513 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
515 project
.SetProjectName("IsoSurfVC");
516 project
.SetTargetName("isosurf");
517 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/isosurf"));
518 project
.SetSourceFiles(wxStringList("isosurf.cpp", "isosurf.h",
521 if (!project
.GenerateVCProject())
523 wxString
msg("Could not generate GLCanvas IsoSurf project");
527 // GLCanvas penguin sample
529 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
530 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
531 project
.SetLibDirs(wxStringList("../../../../lib", 0));
532 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
533 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
534 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
536 project
.SetProjectName("PenguinVC");
537 project
.SetTargetName("penguin");
538 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/penguin"));
539 project
.SetSourceFiles(wxStringList("penguin.cpp", "penguin.h",
541 "trackball.c", "trackball.h",
544 if (!project
.GenerateVCProject())
546 wxString
msg("Could not generate GLCanvas Penguin project");
551 // ----------------------------------------------------------------------------
553 // ----------------------------------------------------------------------------
556 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
557 : wxFrame((wxFrame
*)NULL
, -1, title
, pos
, size
)
559 // set the frame icon
560 SetIcon(wxICON(mondrian
));
563 wxMenu
*menuFile
= new wxMenu
;
565 menuFile
->Append(MakeProject_Generate
, "&Generate");
566 menuFile
->Append(MakeProject_About
, "&About...");
567 menuFile
->AppendSeparator();
568 menuFile
->Append(MakeProject_Quit
, "E&xit");
570 // now append the freshly created menu to the menu bar...
571 wxMenuBar
*menuBar
= new wxMenuBar
;
572 menuBar
->Append(menuFile
, "&File");
574 // ... and attach this menu bar to the frame
577 // create a status bar just for fun (by default with 1 pane only)
579 SetStatusText("Welcome to wxWindows!");
585 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
587 // TRUE is to force the frame to close
591 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
593 wxMessageBox("MakeProject: generates VC++ project files",
594 "About MakeProject", wxOK
| wxICON_INFORMATION
, this);
597 void MyFrame::OnGenerate(wxCommandEvent
& WXUNUSED(event
))
599 wxGetApp().GenerateSamples("d:/wx2/wxWindows");
602 bool MyFrame::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
603 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
)
605 return wxGetApp().GenerateSample(projectName
, targetName
, path
, sourceFiles
, relativeRootPath
);
612 wxProject::wxProject()
616 wxProject::~wxProject()
621 bool wxProject::GenerateVCProject()
623 wxString fullProjectName
= m_path
+ wxString("/") + m_projectName
+ ".dsp";
625 ofstream
stream(fullProjectName
);
629 /////////////////////// General stuff
631 stream
<< "# Microsoft Developer Studio Project File - Name=\"" << m_projectName
<< "\" - Package Owner=<4>\n";
632 stream
<< "# Microsoft Developer Studio Generated Build File, Format Version 5.00\n";
633 stream
<< "# (Actually, generated by MakeProject, (c) Julian Smart, 1998)\n";
634 stream
<< "# ** DO NOT EDIT **\n\n";
635 stream
<< "# TARGTYPE \"Win32 (x86) Application\" 0x0101\n\n";
636 stream
<< "CFG=" << m_projectName
<< " - Win32 Debug\n";
637 stream
<< "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n";
638 stream
<< "!MESSAGE use the Export Makefile command and run\n";
639 stream
<< "!MESSAGE\n";
640 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\".\n";
641 stream
<< "!MESSAGE\n";
642 stream
<< "!MESSAGE You can specify a configuration when running NMAKE\n";
643 stream
<< "!MESSAGE by defining the macro CFG on the command line. For example:\n";
644 stream
<< "!MESSAGE\n";
645 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\" CFG=\"" << m_projectName
<< " - Win32 Debug\"\n";
646 stream
<< "!MESSAGE\n";
647 stream
<< "!MESSAGE Possible choices for configuration are:\n";
648 stream
<< "!MESSAGE\n";
649 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release\" (based on \"Win32 (x86) Application\")\n";
650 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug\" (based on \"Win32 (x86) Application\")\n";
651 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug DLL\" (based on \"Win32 (x86) Application\")\n";
652 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release DLL\" (based on \"Win32 (x86) Application\")\n";
653 stream
<< "!MESSAGE\n";
655 stream
<< "# Begin Project\n";
656 stream
<< "# PROP Scc_ProjName \"\"\n";
657 stream
<< "# PROP Scc_LocalPath \"\"\n";
658 stream
<< "CPP=cl.exe\n";
659 stream
<< "MTL=midl.exe\n";
660 stream
<< "RSC=rc.exe\n";
663 /////////////////////// Win32 Release target
665 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
667 stream
<< "# PROP BASE Use_MFC 0\n";
668 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
669 stream
<< "# PROP BASE Output_Dir \"Release\"\n";
670 stream
<< "# PROP BASE Intermediate_Dir \"Release\"\n";
671 stream
<< "# PROP BASE Target_Dir \"\"\n";
672 stream
<< "# PROP Use_MFC 0\n";
673 stream
<< "# PROP Use_Debug_Libraries 0\n";
674 stream
<< "# PROP Output_Dir \"Release\"\n";
675 stream
<< "# PROP Intermediate_Dir \"Release\"\n";
676 stream
<< "# PROP Ignore_Export_Lib 0\n";
677 stream
<< "# PROP Target_Dir \"\"\n";
678 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
679 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
681 int n
= m_includeDirs
.Number();
683 for (i
= 0; i
< n
; i
++)
685 wxString includeDir
= m_includeDirs
[i
];
686 stream
<< " /I \"" << includeDir
<< "\"";
689 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /FD /c\n";
690 stream
<< "# SUBTRACT CPP /YX\n";
691 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
692 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
693 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
694 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
695 stream
<< "BSC32=bscmake.exe\n";
696 stream
<< "# ADD BASE BSC32 /nologo\n";
697 stream
<< "# ADD BSC32 /nologo\n";
698 stream
<< "LINK32=link.exe\n";
699 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386\n";
700 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib jpeg.lib tiff.lib ";
701 n
= m_extraLibs
.Number();
702 for (i
= 0; i
< n
; i
++)
704 wxString lib
= m_extraLibs
[i
];
705 stream
<< lib
<< " ";
708 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib,libci.lib,msvcrtd.lib\" /out:\"Release/" << m_targetName
<< ".exe\"";
710 n
= m_releaseLibDirs
.Number();
711 for (i
= 0; i
< n
; i
++)
713 wxString libDir
= m_releaseLibDirs
[i
];
714 stream
<< " /libpath:\"" << libDir
<< "\"";
716 n
= m_libDirs
.Number();
717 for (i
= 0; i
< n
; i
++)
719 wxString libDir
= m_libDirs
[i
];
720 stream
<< " /libpath:\"" << libDir
<< "\"";
725 /////////////////////// Win32 Debug target
727 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
729 stream
<< "# PROP BASE Use_MFC 0\n";
730 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
731 stream
<< "# PROP BASE Output_Dir \"Debug\"\n";
732 stream
<< "# PROP BASE Intermediate_Dir \"Debug\"\n";
733 stream
<< "# PROP BASE Target_Dir \"\"\n";
734 stream
<< "# PROP Use_MFC 0\n";
735 stream
<< "# PROP Use_Debug_Libraries 1\n";
736 stream
<< "# PROP Output_Dir \"Debug\"\n";
737 stream
<< "# PROP Intermediate_Dir \"Debug\"\n";
738 stream
<< "# PROP Ignore_Export_Lib 0\n";
739 stream
<< "# PROP Target_Dir \"\"\n";
740 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
741 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
743 n
= m_includeDirs
.Number();
744 for (i
= 0; i
< n
; i
++)
746 wxString includeDir
= m_includeDirs
[i
];
747 stream
<< " /I \"" << includeDir
<< "\"";
750 stream
<< " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D DEBUG=1 /D \"__WXDEBUG__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /Yu\"wx/wxprec.h\" /FD /c\n";
751 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
752 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
753 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
754 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
755 stream
<< "BSC32=bscmake.exe\n";
756 stream
<< "# ADD BASE BSC32 /nologo\n";
757 stream
<< "# ADD BSC32 /nologo\n";
758 stream
<< "LINK32=link.exe\n";
759 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
760 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib jpeg.lib tiff.lib ";
761 n
= m_extraLibs
.Number();
762 for (i
= 0; i
< n
; i
++)
764 wxString lib
= m_extraLibs
[i
];
765 stream
<< lib
<< " ";
767 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName
<< ".exe\" /pdbtype:sept";
769 n
= m_debugLibDirs
.Number();
770 for (i
= 0; i
< n
; i
++)
772 wxString libDir
= m_debugLibDirs
[i
];
773 stream
<< " /libpath:\"" << libDir
<< "\"";
775 n
= m_libDirs
.Number();
776 for (i
= 0; i
< n
; i
++)
778 wxString libDir
= m_libDirs
[i
];
779 stream
<< " /libpath:\"" << libDir
<< "\"";
783 // stream << "!ENDIF\n";
786 /////////////////////// Win32 Debug DLL target
788 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
790 stream
<< "# PROP BASE Use_MFC 0\n";
791 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
792 stream
<< "# PROP BASE Output_Dir \"DebugDLL\"\n";
793 stream
<< "# PROP BASE Intermediate_Dir \"DebugDLL\"\n";
794 stream
<< "# PROP BASE Target_Dir \"\"\n";
795 stream
<< "# PROP Use_MFC 0\n";
796 stream
<< "# PROP Use_Debug_Libraries 1\n";
797 stream
<< "# PROP Output_Dir \"DebugDLL\"\n";
798 stream
<< "# PROP Intermediate_Dir \"DebugDLL\"\n";
799 stream
<< "# PROP Ignore_Export_Lib 0\n";
800 stream
<< "# PROP Target_Dir \"\"\n";
801 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
802 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
804 n
= m_includeDirs
.Number();
805 for (i
= 0; i
< n
; i
++)
807 wxString includeDir
= m_includeDirs
[i
];
808 stream
<< " /I \"" << includeDir
<< "\"";
811 stream
<< " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D DEBUG=1 /D \"__WXDEBUG__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /D WXUSINGDLL=1 /Yu\"wx/wxprec.h\" /FD /c\n";
812 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
813 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
814 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
815 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
816 stream
<< "BSC32=bscmake.exe\n";
817 stream
<< "# ADD BASE BSC32 /nologo\n";
818 stream
<< "# ADD BSC32 /nologo\n";
819 stream
<< "LINK32=link.exe\n";
820 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
821 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib ";
822 n
= m_extraLibs
.Number();
823 for (i
= 0; i
< n
; i
++)
825 wxString lib
= m_extraLibs
[i
];
826 stream
<< lib
<< " ";
828 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName
<< ".exe\" /pdbtype:sept";
830 n
= m_debugLibDirs
.Number();
831 for (i
= 0; i
< n
; i
++)
833 wxString libDir
= m_debugLibDirs
[i
];
834 libDir
+= "DLL"; // Assume that we have e.g. Debug so make it DebugDLL
835 stream
<< " /libpath:\"" << libDir
<< "\"";
837 n
= m_libDirs
.Number();
838 for (i
= 0; i
< n
; i
++)
840 wxString libDir
= m_libDirs
[i
];
841 stream
<< " /libpath:\"" << libDir
<< "\"";
845 // stream << "!ENDIF\n";
848 /////////////////////// Win32 Release DLL target
850 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
852 stream
<< "# PROP BASE Use_MFC 0\n";
853 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
854 stream
<< "# PROP BASE Output_Dir \"ReleaseDLL\"\n";
855 stream
<< "# PROP BASE Intermediate_Dir \"ReleaseDLL\"\n";
856 stream
<< "# PROP BASE Target_Dir \"\"\n";
857 stream
<< "# PROP Use_MFC 0\n";
858 stream
<< "# PROP Use_Debug_Libraries 0\n";
859 stream
<< "# PROP Output_Dir \"ReleaseDLL\"\n";
860 stream
<< "# PROP Intermediate_Dir \"ReleaseDLL\"\n";
861 stream
<< "# PROP Ignore_Export_Lib 0\n";
862 stream
<< "# PROP Target_Dir \"\"\n";
863 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
864 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
866 n
= m_includeDirs
.Number();
867 for (i
= 0; i
< n
; i
++)
869 wxString includeDir
= m_includeDirs
[i
];
870 stream
<< " /I \"" << includeDir
<< "\"";
873 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /D WXUSINGDLL=1 /FD /c\n";
874 stream
<< "# SUBTRACT CPP /YX\n";
875 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
876 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
877 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
878 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
879 stream
<< "BSC32=bscmake.exe\n";
880 stream
<< "# ADD BASE BSC32 /nologo\n";
881 stream
<< "# ADD BSC32 /nologo\n";
882 stream
<< "LINK32=link.exe\n";
883 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386\n";
884 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib ";
885 n
= m_extraLibs
.Number();
886 for (i
= 0; i
< n
; i
++)
888 wxString lib
= m_extraLibs
[i
];
889 stream
<< lib
<< " ";
891 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName
<< ".exe\"";
893 n
= m_releaseLibDirs
.Number();
894 for (i
= 0; i
< n
; i
++)
896 wxString libDir
= m_releaseLibDirs
[i
];
897 libDir
+= "DLL"; // Assume that we have e.g. Release so make it ReleaseDLL
898 stream
<< " /libpath:\"" << libDir
<< "\"";
900 n
= m_libDirs
.Number();
901 for (i
= 0; i
< n
; i
++)
903 wxString libDir
= m_libDirs
[i
];
904 stream
<< " /libpath:\"" << libDir
<< "\"";
908 stream
<< "!ENDIF\n";
911 /////////////////////// Source code for targets
913 stream
<< "# Begin Target\n";
915 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release\"\n";
916 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug\"\n";
917 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
918 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release DLL\"\n";
921 n
= m_sourceFiles
.Number();
922 for (i
= 0; i
< n
; i
++)
924 wxString sourceFile
= m_sourceFiles
[i
];
926 stream
<< "# Begin Source File\n";
928 stream
<< "SOURCE=.\\" << sourceFile
<< "\n";
930 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
932 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
934 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
936 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
938 stream
<< "# SUBTRACT BASE CPP /YX /Yc /Yu\n";
939 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
941 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
943 stream
<< "!ENDIF\n";
945 stream
<< "# End Source File\n";
948 // The .rc file: assume it has the target name + rc extension.
949 stream
<< "# Begin Source File\n";
951 stream
<< "SOURCE=.\\" << m_targetName
<< ".rc\n";
952 stream
<< "# ADD BASE RSC /l 0x809\n";
953 stream
<< "# ADD RSC /l 0x809";
955 n
= m_resourceIncludeDirs
.Number();
956 for (i
= 0; i
< n
; i
++)
958 wxString includeDir
= m_resourceIncludeDirs
[i
];
959 stream
<< " /i \"" << includeDir
<< "\"";
963 stream
<< "# End Source File\n";
964 stream
<< "# End Target\n";
965 stream
<< "# End Project\n";
967 // Now generate the .dsw workspace file
969 wxString fullWorkSpaceName
= m_path
+ wxString("/") + m_projectName
+ ".dsw";
971 ofstream
stream2(fullWorkSpaceName
);
975 stream2
<< "Microsoft Developer Studio Workspace File, Format Version 5.00\n";
976 stream2
<< "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n";
978 stream2
<< "###############################################################################\n";
980 stream2
<< "Project: \"" << m_projectName
<< "\"=.\\" << m_projectName
<< ".dsp - Package Owner=<4>\n";
982 stream2
<< "Package=<5>\n";
986 stream2
<< "Package=<4>\n";
990 stream2
<< "###############################################################################\n";
992 stream2
<< "Global:\n";
994 stream2
<< "Package=<5>\n";
998 stream2
<< "Package=<3>\n";
1002 stream2
<< "###############################################################################\n";
1008 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
1009 EVT_BUTTON(wxID_EXIT
, MyDialog::OnQuit
)
1010 EVT_BUTTON(ID_GENERATE_PROJECT
, MyDialog::OnGenerate
)
1011 EVT_BUTTON(ID_GENERATE_SAMPLES
, MyDialog::OnGenerateSamples
)
1014 // ----------------------------------------------------------------------------
1016 // ----------------------------------------------------------------------------
1018 // frame constructor
1019 MyDialog::MyDialog(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
):
1022 LoadFromResource((wxWindow
*) NULL
, "project_dialog");
1026 void MyDialog::OnQuit(wxCommandEvent
& event
)
1031 void MyDialog::OnAbout(wxCommandEvent
& event
)
1035 void MyDialog::OnGenerate(wxCommandEvent
& event
)
1039 void MyDialog::OnGenerateSamples(wxCommandEvent
& event
)
1041 char* dir
= getenv("WXWIN");
1045 wxTextEntryDialog
dialog(this, "Please enter the wxWindows directory", "Text entry", dirStr
, wxOK
|wxCANCEL
);
1046 if (dialog
.ShowModal() == wxID_OK
)
1048 if (wxDirExists(dialog
.GetValue()))
1050 // wxGetApp().GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"),
1051 // wxStringList("minimal.cpp", 0));
1053 wxGetApp().GenerateSamples(dialog
.GetValue());
1057 wxMessageBox("This directory doesn't exist.");