From a8d199df494e2c5c4404bb51844fb4c9ad31ec52 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Dec 2005 14:14:16 -0500 Subject: [PATCH] BUG: Fix storage/use of argc/argv in CMakeSetup dialog. --- Source/MFCDialog/CMakeCommandLineInfo.cpp | 1 + Source/MFCDialog/CMakeSetup.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/MFCDialog/CMakeCommandLineInfo.cpp b/Source/MFCDialog/CMakeCommandLineInfo.cpp index d286ea059..15c5c811f 100644 --- a/Source/MFCDialog/CMakeCommandLineInfo.cpp +++ b/Source/MFCDialog/CMakeCommandLineInfo.cpp @@ -26,6 +26,7 @@ CMakeCommandLineInfo::CMakeCommandLineInfo() char fname[4096]; ::GetModuleFileName(0, fname, 4096); m_Argv0 = fname; + m_Argv.push_back(m_Argv0.c_str()); } CMakeCommandLineInfo::~CMakeCommandLineInfo() diff --git a/Source/MFCDialog/CMakeSetup.cpp b/Source/MFCDialog/CMakeSetup.cpp index aab984e25..a65d00da3 100644 --- a/Source/MFCDialog/CMakeSetup.cpp +++ b/Source/MFCDialog/CMakeSetup.cpp @@ -94,17 +94,20 @@ BOOL CMakeSetup::InitInstance() // the specific initialization routines you do not need. #if _MFC_VER <= 0x421 #ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL + Enable3dControls(); // Call this when using MFC in a shared DLL #else - Enable3dControlsStatic(); // Call this when linking to MFC statically + Enable3dControlsStatic(); // Call this when linking to MFC statically #endif #endif CMakeCommandLineInfo 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; - if(doc.CheckOptions(cmdInfo.GetArgC(), cmdInfo.GetArgV())) + if(cmdInfo.GetArgC() > 1 && + doc.CheckOptions(cmdInfo.GetArgC(), cmdInfo.GetArgV())) { // Construct and print requested documentation. cmake hcm;