1 /*=========================================================================
3 Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
4 Module: $RCSfile: CMakeSetup.cpp,v $
6 Date: $Date: 2005-08-09 19:42:49 $
7 Version: $Revision: 1.3 $
11 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
12 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notices for more information.
18 =========================================================================*/
20 #if defined(__GNUG__) && !defined(__APPLE__)
21 #pragma implementation "CMakeSetup.h"
24 // For compilers that support precompilation, includes "wx/wx.h".
25 #include "wx/wxprec.h"
38 #include <wx/filename.h>
40 #include "cmSystemTools.h"
41 #include "CommandLineInfo.h"
43 #include "CMakeSetup.h"
44 #include "CMakeSetupFrame.h"
50 * Application instance implementation
53 ////@begin implement app
54 IMPLEMENT_APP( CMakeSetupApp
)
55 ////@end implement app
58 * CMakeSetupApp type definition
61 IMPLEMENT_CLASS( CMakeSetupApp
, wxApp
)
64 * CMakeSetupApp event table definition
67 BEGIN_EVENT_TABLE( CMakeSetupApp
, wxApp
)
69 ////@begin CMakeSetupApp event table entries
70 ////@end CMakeSetupApp event table entries
75 * Constructor for CMakeSetupApp
78 CMakeSetupApp::CMakeSetupApp()
80 ////@begin CMakeSetupApp member initialisation
81 ////@end CMakeSetupApp member initialisation
85 * Initialisation for CMakeSetupApp
88 bool CMakeSetupApp::OnInit()
90 cmSystemTools::DisableRunCommandOutput();
92 // parse command line params
94 if(!cm
.ParseCommandLine(wxApp::argc
, wxApp::argv
))
96 printf("Error while parsing the command line\n");
100 // set vendor name and app for config
101 SetVendorName("Kitware");
102 SetAppName("CMakeSetup");
104 CMakeSetupFrm
*MyFrame
= new CMakeSetupFrm(NULL
);
106 // alternative app path way, somehow otherwise it does not work
107 wxFileName
fname(argv
[0]);
108 MyFrame
->DoInitFrame(cm
, fname
.GetPath(wxPATH_GET_SEPARATOR
| wxPATH_GET_VOLUME
));
115 * Cleanup for CMakeSetupApp
117 int CMakeSetupApp::OnExit()
119 ////@begin CMakeSetupApp cleanup
120 return wxApp::OnExit();
121 ////@end CMakeSetupApp cleanup