CMakeSetup.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // CMakeSetupdialog.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "CMakeSetup.h"
  5. #include "CMakeSetupDialog.h"
  6. #include "CMakeCommandLineInfo.h"
  7. #include "../cmListFileCache.h"
  8. #include "../cmMakefileGenerator.h"
  9. #include "../cmCacheManager.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMakeSetup
  17. BEGIN_MESSAGE_MAP(CMakeSetup, CWinApp)
  18. //{{AFX_MSG_MAP(CMakeSetup)
  19. // NOTE - the ClassWizard will add and remove mapping macros here.
  20. // DO NOT EDIT what you see in these blocks of generated code!
  21. //}}AFX_MSG
  22. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  23. END_MESSAGE_MAP();
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMakeSetup construction
  26. CMakeSetup::CMakeSetup()
  27. {
  28. // TODO: add construction code here,
  29. // Place all significant initialization in InitInstance
  30. }
  31. /////////////////////////////////////////////////////////////////////////////
  32. // The one and only CMakeSetup object
  33. CMakeSetup theApp;
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMakeSetup initialization
  36. BOOL CMakeSetup::InitInstance()
  37. {
  38. AfxEnableControlContainer();
  39. // Standard initialization
  40. // If you are not using these features and wish to reduce the size
  41. // of your final executable, you should remove from the following
  42. // the specific initialization routines you do not need.
  43. #if _MFC_VER <= 0x421
  44. #ifdef _AFXDLL
  45. Enable3dControls(); // Call this when using MFC in a shared DLL
  46. #else
  47. Enable3dControlsStatic(); // Call this when linking to MFC statically
  48. #endif
  49. #endif
  50. CMakeCommandLineInfo cmdInfo;
  51. ParseCommandLine(cmdInfo);
  52. CMakeSetupDialog dlg(cmdInfo);
  53. m_pMainWnd = &dlg;
  54. INT_PTR nResponse = dlg.DoModal();
  55. if (nResponse == IDOK)
  56. {
  57. // TODO: Place code here to handle when the dialog is
  58. // dismissed with OK
  59. }
  60. else if (nResponse == IDCANCEL)
  61. {
  62. // TODO: Place code here to handle when the dialog is
  63. // dismissed with Cancel
  64. }
  65. // clean up globals
  66. cmListFileCache::GetInstance()->ClearCache();
  67. cmMakefileGenerator::UnRegisterGenerators();
  68. cmCacheManager::DeleteInstance();
  69. // Since the dialog has been closed, return FALSE so that we exit the
  70. // application, rather than start the application's message pump.
  71. return FALSE;
  72. }