BUG: Fix storage/use of argc/argv in CMakeSetup dialog.

This commit is contained in:
Brad King 2005-12-13 14:14:16 -05:00
parent be019c96d4
commit a8d199df49
2 changed files with 9 additions and 5 deletions

View File

@ -26,6 +26,7 @@ CMakeCommandLineInfo::CMakeCommandLineInfo()
char fname[4096]; char fname[4096];
::GetModuleFileName(0, fname, 4096); ::GetModuleFileName(0, fname, 4096);
m_Argv0 = fname; m_Argv0 = fname;
m_Argv.push_back(m_Argv0.c_str());
} }
CMakeCommandLineInfo::~CMakeCommandLineInfo() CMakeCommandLineInfo::~CMakeCommandLineInfo()

View File

@ -94,17 +94,20 @@ BOOL CMakeSetup::InitInstance()
// the specific initialization routines you do not need. // the specific initialization routines you do not need.
#if _MFC_VER <= 0x421 #if _MFC_VER <= 0x421
#ifdef _AFXDLL #ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL Enable3dControls(); // Call this when using MFC in a shared DLL
#else #else
Enable3dControlsStatic(); // Call this when linking to MFC statically Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif #endif
#endif #endif
CMakeCommandLineInfo cmdInfo; CMakeCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo); ParseCommandLine(cmdInfo);
// Check for documentation options. // Check for documentation options. If there are no arguments skip
// the check because the GUI should be displayed instead of showing
// usage in this case.
cmDocumentation doc; cmDocumentation doc;
if(doc.CheckOptions(cmdInfo.GetArgC(), cmdInfo.GetArgV())) if(cmdInfo.GetArgC() > 1 &&
doc.CheckOptions(cmdInfo.GetArgC(), cmdInfo.GetArgV()))
{ {
// Construct and print requested documentation. // Construct and print requested documentation.
cmake hcm; cmake hcm;