summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-12-13 19:14:16 (GMT)
committerBrad King <brad.king@kitware.com>2005-12-13 19:14:16 (GMT)
commita8d199df494e2c5c4404bb51844fb4c9ad31ec52 (patch)
tree612315bff6c82beb47a327d9e302d873f11c2d6d /Source/MFCDialog
parentbe019c96d45ede1b37a17fc7fa60655a33537410 (diff)
downloadCMake-a8d199df494e2c5c4404bb51844fb4c9ad31ec52.zip
CMake-a8d199df494e2c5c4404bb51844fb4c9ad31ec52.tar.gz
CMake-a8d199df494e2c5c4404bb51844fb4c9ad31ec52.tar.bz2
BUG: Fix storage/use of argc/argv in CMakeSetup dialog.
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r--Source/MFCDialog/CMakeCommandLineInfo.cpp1
-rw-r--r--Source/MFCDialog/CMakeSetup.cpp13
2 files changed, 9 insertions, 5 deletions
diff --git a/Source/MFCDialog/CMakeCommandLineInfo.cpp b/Source/MFCDialog/CMakeCommandLineInfo.cpp
index d286ea0..15c5c81 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 aab984e..a65d00d 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;