CMakeSetup.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*=========================================================================
  2. Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Author: Jorgen Bodde
  8. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  9. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  10. This software is distributed WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE. See the above copyright notices for more information.
  13. =========================================================================*/
  14. #if defined(__GNUG__) && !defined(__APPLE__)
  15. #pragma implementation "CMakeSetup.h"
  16. #endif
  17. // For compilers that support precompilation, includes "wx/wx.h".
  18. #include "wx/wxprec.h"
  19. #ifdef __BORLANDC__
  20. #pragma hdrstop
  21. #endif
  22. #ifndef WX_PRECOMP
  23. #include "wx/wx.h"
  24. #endif
  25. ////@begin includes
  26. ////@end includes
  27. #include <wx/filename.h>
  28. #include "cmSystemTools.h"
  29. #include "CommandLineInfo.h"
  30. #include "CMakeSetup.h"
  31. #include "CMakeSetupFrame.h"
  32. ////@begin XPM images
  33. ////@end XPM images
  34. /*!
  35. * Application instance implementation
  36. */
  37. ////@begin implement app
  38. IMPLEMENT_APP( CMakeSetupApp )
  39. ////@end implement app
  40. /*!
  41. * CMakeSetupApp type definition
  42. */
  43. IMPLEMENT_CLASS( CMakeSetupApp, wxApp )
  44. /*!
  45. * CMakeSetupApp event table definition
  46. */
  47. BEGIN_EVENT_TABLE( CMakeSetupApp, wxApp )
  48. ////@begin CMakeSetupApp event table entries
  49. ////@end CMakeSetupApp event table entries
  50. END_EVENT_TABLE()
  51. /*!
  52. * Constructor for CMakeSetupApp
  53. */
  54. CMakeSetupApp::CMakeSetupApp()
  55. {
  56. ////@begin CMakeSetupApp member initialisation
  57. ////@end CMakeSetupApp member initialisation
  58. }
  59. /*!
  60. * Initialisation for CMakeSetupApp
  61. */
  62. bool CMakeSetupApp::OnInit()
  63. {
  64. cmSystemTools::DisableRunCommandOutput();
  65. // parse command line params
  66. cmCommandLineInfo cm;
  67. if(!cm.ParseCommandLine(wxApp::argc, wxApp::argv))
  68. {
  69. printf("Error while parsing the command line\n");
  70. return false;
  71. }
  72. // set vendor name and app for config
  73. SetVendorName("Kitware");
  74. SetAppName("CMakeSetup");
  75. CMakeSetupFrm *MyFrame = new CMakeSetupFrm(NULL);
  76. // alternative app path way, somehow otherwise it does not work
  77. wxFileName fname(argv[0]);
  78. MyFrame->DoInitFrame(cm, fname.GetPath(wxPATH_GET_SEPARATOR | wxPATH_GET_VOLUME));
  79. MyFrame->Show(TRUE);
  80. return true;
  81. }
  82. /*!
  83. * Cleanup for CMakeSetupApp
  84. */
  85. int CMakeSetupApp::OnExit()
  86. {
  87. ////@begin CMakeSetupApp cleanup
  88. return wxApp::OnExit();
  89. ////@end CMakeSetupApp cleanup
  90. }