CMakeSetup.cpp 2.3 KB

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