From 154529bd1c3fc27493c92c93a21676d492875c38 Mon Sep 17 00:00:00 2001 From: Jorgen Bodde Date: Mon, 8 Aug 2005 17:14:08 -0400 Subject: Started on command line parsing, added string parse method for default generator --- Source/WXDialog/CMakeSetup.cpp | 2 +- Source/WXDialog/CMakeSetup.pjd | 345 ++++++++++++++++++------------------ Source/WXDialog/CMakeSetupFrame.cpp | 22 +-- Source/WXDialog/CommandLineInfo.cpp | 154 ++++++++++------ Source/WXDialog/CommandLineInfo.h | 6 +- Source/WXDialog/cmakesetup.xml | 26 +-- 6 files changed, 302 insertions(+), 253 deletions(-) diff --git a/Source/WXDialog/CMakeSetup.cpp b/Source/WXDialog/CMakeSetup.cpp index 8816461..2e1dedd 100644 --- a/Source/WXDialog/CMakeSetup.cpp +++ b/Source/WXDialog/CMakeSetup.cpp @@ -91,7 +91,7 @@ bool CMakeSetupApp::OnInit() // parse command line params cmCommandLineInfo cm; - cm.SetValidArguments("ABGHQ"); + cm.SetValidArguments("ABGHQG"); cm.ParseCommandLine(wxApp::argc, wxApp::argv); // set vendor name and app for config diff --git a/Source/WXDialog/CMakeSetup.pjd b/Source/WXDialog/CMakeSetup.pjd index 0dd9543..fec0a4f 100644 --- a/Source/WXDialog/CMakeSetup.pjd +++ b/Source/WXDialog/CMakeSetup.pjd @@ -78,7 +78,7 @@ <None> - 14941224 + 15088528 data-document @@ -89,14 +89,14 @@ 0 Configurations - 14901752 + 15310432 config-data-document 0 1 0 - 14941224 + 15088528 0 TRUE @@ -144,7 +144,7 @@ Projects - 14941112 + 15057456 root-document project @@ -155,25 +155,25 @@ 0 Windows - 14970776 + 15140496 html-document dialogsfolder 1 1 0 - 14941112 + 15057456 1 CMakeSetupApp - 14557712 + 14833712 dialog-document app 0 1 0 - 14970776 + 15140496 0 7/4/2005 wbAppProxy @@ -189,14 +189,14 @@ CMake Setup - 14557936 + 15139352 dialog-document frame 0 1 0 - 14970776 + 15140496 0 7/4/2005 wbFrameProxy @@ -257,14 +257,14 @@ wxSplitterWindow: ID_SPLITTERWINDOW - 15131328 + 15327264 dialog-control-document splitter 0 1 0 - 14557936 + 15139352 0 7/4/2005 wbSplitterWindowProxy @@ -321,14 +321,14 @@ wxPanel: ID_MAINPANEL - 15012400 + 15222232 dialog-control-document panel 0 1 0 - 15131328 + 15327264 0 7/4/2005 wbPanelProxy @@ -380,14 +380,14 @@ wxBoxSizer V - 15305752 + 15211392 dialog-control-document sizer 0 1 0 - 15012400 + 15222232 0 7/4/2005 wbBoxSizerProxy @@ -407,14 +407,14 @@ <Any platform> wxBoxSizer H - 15063344 + 15336232 dialog-control-document sizer 0 1 0 - 15305752 + 15211392 0 7/4/2005 wbBoxSizerProxy @@ -434,14 +434,14 @@ <Any platform> wxFlexGridSizer - 15010096 + 15345208 dialog-control-document sizer 0 1 0 - 15063344 + 15336232 0 7/4/2005 wbFlexGridSizerProxy @@ -466,14 +466,14 @@ FALSE wxStaticText: wxID_STATIC - 15060672 + 15174904 dialog-control-document statictext 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbStaticTextProxy @@ -523,14 +523,14 @@ wxTextCtrl: ID_PROJECT_PATH - 15158408 + 15369448 dialog-control-document textctrl 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbTextCtrlProxy @@ -591,14 +591,14 @@ wxButton: ID_BROWSE_PROJECT - 15128288 + 15341600 dialog-control-document dialogcontrol 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbButtonProxy @@ -644,14 +644,14 @@ wxStaticText: wxID_STATIC - 15128064 + 15095456 dialog-control-document statictext 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbStaticTextProxy @@ -701,14 +701,14 @@ wxTextCtrl: ID_SOURCE_BUILD_PATH - 14975400 + 15114544 dialog-control-document textctrl 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbTextCtrlProxy @@ -771,14 +771,14 @@ wxButton: ID_BROWSE_BUILD - 15219840 + 15258912 dialog-control-document dialogcontrol 0 1 0 - 15010096 + 15345208 0 7/4/2005 wbButtonProxy @@ -825,14 +825,14 @@ wxBoxSizer V - 15219616 + 15234376 dialog-control-document sizer 0 1 0 - 15063344 + 15336232 0 7/4/2005 wbBoxSizerProxy @@ -852,14 +852,14 @@ <Any platform> wxFlexGridSizer - 15024832 + 15190200 dialog-control-document sizer 0 1 0 - 15219616 + 15234376 0 21/4/2005 wbFlexGridSizerProxy @@ -884,14 +884,14 @@ FALSE wxStaticText: wxID_STATIC - 15170512 + 15184416 dialog-control-document statictext 0 1 0 - 15024832 + 15190200 0 28/4/2005 wbStaticTextProxy @@ -941,14 +941,14 @@ wxComboBox: ID_CHOOSE_GENERATOR - 15214776 + 15380104 dialog-control-document combobox 0 1 0 - 15024832 + 15190200 0 28/4/2005 wbComboBoxProxy @@ -993,14 +993,14 @@ wxStaticText: wxID_STATIC - 15214552 + 15143832 dialog-control-document statictext 0 1 0 - 15024832 + 15190200 0 21/4/2005 wbStaticTextProxy @@ -1050,14 +1050,14 @@ wxComboBox: ID_SEARCHQUERY - 15160272 + 15164688 dialog-control-document combobox 0 1 0 - 15024832 + 15190200 0 21/4/2005 wbComboBoxProxy @@ -1105,14 +1105,14 @@ wxCheckBox: ID_SHOW_ADVANCED - 15194888 + 15248616 dialog-control-document checkbox 0 1 0 - 15219616 + 15234376 0 7/4/2005 wbCheckBoxProxy @@ -1160,14 +1160,14 @@ wxGrid: ID_OPTIONS - 15160048 + 15335040 dialog-control-document grid 0 1 0 - 15305752 + 15211392 0 7/4/2005 wbGridProxy @@ -1230,14 +1230,14 @@ wxPanel: ID_LOGPANEL - 15305304 + 15443800 dialog-control-document panel 0 1 0 - 15131328 + 15327264 0 7/4/2005 wbPanelProxy @@ -1289,14 +1289,14 @@ wxBoxSizer V - 15274912 + 15414728 dialog-control-document sizer 0 1 0 - 15305304 + 15443800 0 7/4/2005 wbBoxSizerProxy @@ -1316,14 +1316,14 @@ <Any platform> wxBoxSizer H - 15282864 + 15422736 dialog-control-document sizer 0 1 0 - 15274912 + 15414728 0 8/4/2005 wbBoxSizerProxy @@ -1343,14 +1343,14 @@ <Any platform> wxTextCtrl: ID_LOG_AREA - 15291488 + 15432752 dialog-control-document textctrl 0 1 0 - 15282864 + 15422736 0 8/4/2005 wbTextCtrlProxy @@ -1413,14 +1413,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxTextCtrl: ID_DESCRIPTION - 31865312 + 35749000 dialog-control-document textctrl 0 1 0 - 15282864 + 15422736 0 8/4/2005 wbTextCtrlProxy @@ -1482,14 +1482,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer H - 31885600 + 35769328 dialog-control-document sizer 0 1 0 - 15274912 + 15414728 0 7/4/2005 wbBoxSizerProxy @@ -1509,14 +1509,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> wxButton: ID_DO_CONFIGURE - 31891896 + 35775496 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 7/4/2005 wbButtonProxy @@ -1562,14 +1562,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_DO_OK - 31906136 + 35789784 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 7/4/2005 wbButtonProxy @@ -1615,14 +1615,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_DO_CANCEL - 31920296 + 35804120 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 23/4/2005 wbButtonProxy @@ -1668,14 +1668,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxStaticLine: wxID_STATIC - 31934496 + 35818312 dialog-control-document staticline 0 1 0 - 31885600 + 35769328 0 23/4/2005 wbStaticLineProxy @@ -1716,14 +1716,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_DO_DELETE_CACHE - 31947384 + 35831264 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 8/4/2005 wbButtonProxy @@ -1769,14 +1769,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_CLEAR_LOG - 31961512 + 35845416 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 23/4/2005 wbButtonProxy @@ -1822,14 +1822,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxStaticLine: wxID_STATIC - 31975712 + 35859640 dialog-control-document staticline 0 1 0 - 31885600 + 35769328 0 23/4/2005 wbStaticLineProxy @@ -1870,14 +1870,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_BROWSE_GRID - 31988648 + 35872520 dialog-control-document dialogcontrol 0 1 0 - 31885600 + 35769328 0 23/4/2005 wbButtonProxy @@ -1927,14 +1927,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxStatusBar: ID_STATUSBAR - 15169112 + 15182152 dialog-control-document statusbar 0 1 0 - 14557936 + 15139352 0 7/4/2005 wbStatusBarProxy @@ -1982,14 +1982,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxMenuBar: ID_CMAKE_MENUBAR - 31891672 + 35895160 dialog-control-document menubar 0 1 0 - 14557936 + 15139352 0 19/4/2005 wbMenuBarProxy @@ -1997,14 +1997,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> File - 32012808 + 35897080 dialog-control-document menu 0 1 0 - 31891672 + 35895160 0 19/4/2005 wbMenuProxy @@ -2012,14 +2012,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> &Reload Cache\tCtrl+R: ID_MENU_RELOAD_CACHE - 32014784 + 35899080 dialog-control-document menuitem 0 1 0 - 32012808 + 35897080 0 19/4/2005 wbMenuItemProxy @@ -2035,14 +2035,14 @@ Right click on a cache value for additional options (delete and ignore). Press c &Delete Cache\tCtrl+D: ID_MENU_DELETE_CACHE - 32018496 + 35902816 dialog-control-document menuitem 0 1 0 - 32012808 + 35897080 0 19/4/2005 wbMenuItemProxy @@ -2058,14 +2058,14 @@ Right click on a cache value for additional options (delete and ignore). Press c ------------ - 32022168 + 35906472 dialog-control-document menuitem 0 1 0 - 32012808 + 35897080 0 19/4/2005 wbMenuSeparatorProxy @@ -2073,14 +2073,14 @@ Right click on a cache value for additional options (delete and ignore). Press c E&xit\tAlt+F4: ID_MENU_QUIT - 32023984 + 35908352 dialog-control-document menuitem 0 1 0 - 32012808 + 35897080 0 19/4/2005 wbMenuItemProxy @@ -2097,14 +2097,14 @@ Right click on a cache value for additional options (delete and ignore). Press c Tools - 32027696 + 35912048 dialog-control-document menu 0 1 0 - 31891672 + 35895160 0 29/4/2005 wbMenuProxy @@ -2112,14 +2112,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> &Configure\tCtrl+N: ID_MENU_CONFIGURE - 32029440 + 35913904 dialog-control-document menuitem 0 1 0 - 32027696 + 35912048 0 31/4/2005 wbMenuItemProxy @@ -2135,14 +2135,14 @@ Right click on a cache value for additional options (delete and ignore). Press c &Generate and Exit\tCtrl+G: ID_MENU_EXITGENERATE - 32033160 + 35917648 dialog-control-document menuitem 0 1 0 - 32027696 + 35912048 0 31/4/2005 wbMenuItemProxy @@ -2158,14 +2158,14 @@ Right click on a cache value for additional options (delete and ignore). Press c Toggle &Advanced\tCtrl+A: ID_MENU_TOGGLE_ADVANCED - 15388832 + 35921344 dialog-control-document menuitem 0 1 0 - 32027696 + 35912048 0 31/4/2005 wbMenuItemProxy @@ -2181,14 +2181,14 @@ Right click on a cache value for additional options (delete and ignore). Press c ------------ - 32036848 + 35925000 dialog-control-document menuitem 0 1 0 - 32027696 + 35912048 0 31/4/2005 wbMenuSeparatorProxy @@ -2196,14 +2196,14 @@ Right click on a cache value for additional options (delete and ignore). Press c &Options\tCtrl+O: ID_CMAKE_OPTIONS - 32038704 + 35926880 dialog-control-document menuitem 0 1 0 - 32027696 + 35912048 0 31/4/2005 wbMenuItemProxy @@ -2220,14 +2220,14 @@ Right click on a cache value for additional options (delete and ignore). Press c Help - 32042336 + 35930576 dialog-control-document menu 0 1 0 - 31891672 + 35895160 0 29/4/2005 wbMenuProxy @@ -2235,14 +2235,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> &About ...: ID_ABOUTDLG - 32044160 + 35932424 dialog-control-document menuitem 0 1 0 - 32042336 + 35930576 0 29/4/2005 wbMenuItemProxy @@ -2261,14 +2261,14 @@ Right click on a cache value for additional options (delete and ignore). Press c CachePopupMenu - 14983520 + 15138824 dialog-document menu 0 1 0 - 14970776 + 15140496 0 wbStandaloneMenuProxy 10050 @@ -2279,14 +2279,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> &Ignore cache entry: ID_CACHE_IGNORE - 32048400 + 35936824 dialog-control-document menuitem 0 1 0 - 14983520 + 15138824 0 16/4/2005 wbMenuItemProxy @@ -2301,14 +2301,14 @@ Right click on a cache value for additional options (delete and ignore). Press c &Delete cache entry: ID_CACHE_DELETE - 32052016 + 35940576 dialog-control-document menuitem 0 1 0 - 14983520 + 15138824 0 16/4/2005 wbMenuItemProxy @@ -2323,14 +2323,14 @@ Right click on a cache value for additional options (delete and ignore). Press c ------------ - 32055608 + 35944192 dialog-control-document menuitem 0 1 0 - 14983520 + 15138824 0 23/4/2005 wbMenuSeparatorProxy @@ -2338,14 +2338,14 @@ Right click on a cache value for additional options (delete and ignore). Press c &Browse ...: ID_CACHE_BROWSE - 32057208 + 35945856 dialog-control-document menuitem 0 1 0 - 14983520 + 15138824 0 23/4/2005 wbMenuItemProxy @@ -2361,14 +2361,14 @@ Right click on a cache value for additional options (delete and ignore). Press c Progress Dialog - 32060872 + 35949536 dialog-document dialog 0 1 0 - 14970776 + 15140496 0 27/4/2005 wbDialogProxy @@ -2427,14 +2427,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer V - 32078568 + 35967376 dialog-control-document sizer 0 1 0 - 32060872 + 35949536 0 wbBoxSizerProxy Vertical @@ -2453,14 +2453,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> Spacer - 32086456 + 35975296 dialog-control-document spacer 0 1 0 - 32078568 + 35967376 0 27/4/2005 wbSpacerProxy @@ -2481,14 +2481,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxStaticText: wxID_STATIC - 32093136 + 35982864 dialog-control-document statictext 0 1 0 - 32078568 + 35967376 0 27/4/2005 wbStaticTextProxy @@ -2538,14 +2538,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer H - 32109792 + 35998688 dialog-control-document sizer 0 1 0 - 32078568 + 35967376 0 27/4/2005 wbBoxSizerProxy @@ -2565,14 +2565,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> wxGauge: ID_CMAKE_PROGRESS - 32116776 + 36006648 dialog-control-document gauge 0 1 0 - 32109792 + 35998688 0 27/4/2005 wbGaugeProxy @@ -2624,14 +2624,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_CMAKE_BUTTON - 32133864 + 36022448 dialog-control-document dialogcontrol 0 1 0 - 32078568 + 35967376 0 27/4/2005 wbButtonProxy @@ -2677,14 +2677,14 @@ Right click on a cache value for additional options (delete and ignore). Press c Spacer - 32133640 + 36035776 dialog-control-document spacer 0 1 0 - 32078568 + 35967376 0 27/4/2005 wbSpacerProxy @@ -2707,14 +2707,14 @@ Right click on a cache value for additional options (delete and ignore). Press c About ... - 15183080 + 15317784 dialog-document dialog 0 1 0 - 14970776 + 15140496 0 27/4/2005 wbDialogProxy @@ -2773,14 +2773,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer V - 32168512 + 36057296 dialog-control-document sizer 0 1 0 - 15183080 + 15317784 0 wbBoxSizerProxy Vertical @@ -2799,14 +2799,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> wxFlexGridSizer - 32176768 + 36065536 dialog-control-document sizer 0 1 0 - 32168512 + 36057296 0 28/4/2005 wbFlexGridSizerProxy @@ -2831,14 +2831,14 @@ Right click on a cache value for additional options (delete and ignore). Press c FALSE wxStaticBitmap: wxID_STATIC - 32187248 + 36075864 dialog-control-document staticbitmap 0 1 0 - 32176768 + 36065536 0 28/4/2005 wbStaticBitmapProxy @@ -2882,14 +2882,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxHtmlWindow: ID_HTMLWINDOW - 32186448 + 36090408 dialog-control-document htmlwindow 0 1 0 - 32176768 + 36065536 0 28/4/2005 wbHtmlWindowProxy @@ -2944,14 +2944,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: ID_ABOUT_DLG_OK - 32218992 + 36107664 dialog-control-document dialogcontrol 0 1 0 - 32168512 + 36057296 0 28/4/2005 wbButtonProxy @@ -2999,14 +2999,14 @@ Right click on a cache value for additional options (delete and ignore). Press c CMakeSetup Options ... - 32218768 + 35982000 dialog-document dialog 0 1 0 - 14970776 + 15140496 0 29/4/2005 wbDialogProxy @@ -3065,14 +3065,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer V - 32246976 + 36135880 dialog-control-document sizer 0 1 0 - 32218768 + 35982000 0 wbBoxSizerProxy Vertical @@ -3091,14 +3091,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> wxNotebook: ID_NOTEBOOK - 32255440 + 36145472 dialog-control-document notebook 0 1 0 - 32246976 + 36135880 0 29/4/2005 wbNotebookProxy @@ -3123,6 +3123,7 @@ Right click on a cache value for additional options (delete and ignore). Press c FALSE FALSE FALSE + FALSE FALSE FALSE FALSE @@ -3152,14 +3153,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxPanel: ID_PANEL - 32276584 + 36166888 dialog-control-document panel 0 1 0 - 32255440 + 36145472 0 29/4/2005 wbPanelProxy @@ -3213,14 +3214,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer V - 32296720 + 36317128 dialog-control-document sizer 0 1 0 - 32276584 + 36166888 0 29/4/2005 wbBoxSizerProxy @@ -3240,14 +3241,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> Spacer - 32304784 + 36325216 dialog-control-document spacer 0 1 0 - 32296720 + 36317128 0 29/4/2005 wbSpacerProxy @@ -3268,14 +3269,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxCheckBox: ID_CHECKBOX_CLOSECMAKE - 32443856 + 36332952 dialog-control-document checkbox 0 1 0 - 32296720 + 36317128 0 29/4/2005 wbCheckBoxProxy @@ -3324,14 +3325,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxBoxSizer H - 32442960 + 36164088 dialog-control-document sizer 0 1 0 - 32246976 + 36135880 0 29/4/2005 wbBoxSizerProxy @@ -3351,14 +3352,14 @@ Right click on a cache value for additional options (delete and ignore). Press c <Any platform> wxButton: wxID_OK - 32459328 + 36348448 dialog-control-document dialogcontrol 0 1 0 - 32442960 + 36164088 0 29/4/2005 wbButtonProxy @@ -3403,14 +3404,14 @@ Right click on a cache value for additional options (delete and ignore). Press c wxButton: wxID_CANCEL - 32473152 + 36362168 dialog-control-document dialogcontrol 0 1 0 - 32442960 + 36164088 0 29/4/2005 wbButtonProxy @@ -3459,25 +3460,25 @@ Right click on a cache value for additional options (delete and ignore). Press c Sources - 15249400 + 15191936 html-document sourcesfolder 1 1 0 - 14941112 + 15057456 1 CMakeSetup.rc - 15249512 + 15091464 source-editor-document CMakeSetup.rc source-editor 0 0 1 - 15249400 + 15191936 0 7/4/2005 @@ -3485,25 +3486,25 @@ Right click on a cache value for additional options (delete and ignore). Press c Images - 32201280 + 36089928 html-document bitmapsfolder 1 1 0 - 14941112 + 15057456 1 NGDialog.ico - 32201456 + 36090080 image-document NGDialog.ico image 0 0 0 - 32201280 + 36089928 0 25/4/2005 100 diff --git a/Source/WXDialog/CMakeSetupFrame.cpp b/Source/WXDialog/CMakeSetupFrame.cpp index c4072ca..9c2aad8 100644 --- a/Source/WXDialog/CMakeSetupFrame.cpp +++ b/Source/WXDialog/CMakeSetupFrame.cpp @@ -614,16 +614,7 @@ void CMakeSetupFrm::CreateControls() } void CMakeSetupFrm::DoInitFrame(cmCommandLineInfo &cm, const wxString &fn) -{ - // create accelerator table for some commands - // not very useful if the focus is on an edit ctrl all the time ;-) - //wxAcceleratorEntry entries[3]; - //entries[0].Set(wxACCEL_NORMAL, (int) 'c', ID_MENU_CONFIGURE); - //entries[1].Set(wxACCEL_NORMAL, (int) 'g', ID_MENU_EXITGENERATE); - //entries[2].Set(wxACCEL_NORMAL, (int) 't', ID_MENU_TOGGLE_ADVANCED); - //wxAcceleratorTable accel(3, entries); - //SetAcceleratorTable(accel); - +{ // path to where cmake.exe is // m_PathToExecutable = cm.GetPathToExecutable().c_str(); m_PathToExecutable = fn; @@ -669,8 +660,17 @@ void CMakeSetupFrm::DoInitFrame(cmCommandLineInfo &cm, const wxString &fn) // sync advanced option with grid m_cmOptions->SetShowAdvanced(m_cmShowAdvanced->GetValue()); + // if we have a command line query that a generator + // needs to be chosen instead of the default, take it + bool foundGivenGenerator = false; + if(!cm.m_GeneratorChoiceString.IsEmpty()) + { + // set proper discovered generator + foundGivenGenerator = m_cmGeneratorChoice->SetStringSelection(cm.m_GeneratorChoiceString); + } + // if none selected, we will see if VS8, VS7 or VS6 is present - if(m_cmGeneratorChoice->GetValue().IsEmpty()) + if(!foundGivenGenerator || m_cmGeneratorChoice->GetValue().IsEmpty()) { std::string mp; mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path]"; diff --git a/Source/WXDialog/CommandLineInfo.cpp b/Source/WXDialog/CommandLineInfo.cpp index 490dd61..5f6b14e 100644 --- a/Source/WXDialog/CommandLineInfo.cpp +++ b/Source/WXDialog/CommandLineInfo.cpp @@ -17,6 +17,17 @@ =========================================================================*/ +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + #include "CommandLineInfo.h" #include "cmSystemTools.h" @@ -29,7 +40,7 @@ cmCommandLineInfo::cmCommandLineInfo() this->m_WhereSource = ""; this->m_WhereBuild = ""; this->m_AdvancedValues = false; - this->m_GeneratorChoiceString = ""; + m_GeneratorChoiceString.Empty(); this->m_LastUnknownParameter = ""; this->m_ValidArguments = ""; this->m_ExitAfterLoad = false; @@ -43,23 +54,18 @@ cmCommandLineInfo::~cmCommandLineInfo() /////////////////////////////////////////////////////////////// void cmCommandLineInfo::ParseCommandLine(int argc, char* argv[]) { - int cc; - for ( cc = 1; cc < argc; cc ++ ) + for ( int cc = 1; cc < argc; cc ++ ) { - if ( strlen(argv[cc]) < 1 ) - { - continue; - } - bool valid = true; - std::string argument = argv[cc]; - if ( argument.size() > 1 && - this->m_ValidArguments.find(argument[1]) == std::string::npos ) - { - valid = false; - } - this->ParseParam(argument, valid, (cc + 1 == argc)); + if ( strlen(argv[cc]) < 1 ) + continue; + + std::string argument = argv[cc]; + bool valid = ((argument.size() > 1) && (m_ValidArguments.find(argument[1]) == std::string::npos)); + + ParseParam(argument, valid, (cc + 1 == argc)); } - this->m_ExecutablePath = cmSystemTools::GetFilenamePath(argv[0]); + + m_ExecutablePath = cmSystemTools::GetFilenamePath(argv[0]); } /////////////////////////////////////////////////////////////// @@ -88,49 +94,83 @@ int cmCommandLineInfo::GetBoolValue(const std::string& v) { void cmCommandLineInfo::ParseParam(const std::string& parameter, bool know_about, bool /*last*/) { - if(!know_about) + // this is the last parameter we know, so we assign this to be + // path to source or path to existing build + if(!know_about) + m_LastUnknownParameter = parameter; + else { - this->m_LastUnknownParameter = parameter; + std::string sParam(parameter.c_str(), 1, parameter.npos); + + // Single letter valued flag like /B=value or /B:value + std::string value; + if (sParam[1] == '=' || sParam[1] == ':') + { + value = std::string(parameter.c_str()+3); + } + else + { + value = std::string(parameter.c_str()+2); + } + int res; + + switch (sParam[0]) + { + case 'A': + res = cmCommandLineInfo::GetBoolValue(value); + if (res == 1) + { + m_AdvancedValues = true; + } + else if (res == -1) + { + m_AdvancedValues = false; + } + break; + + case 'B': + m_WhereBuild = value; + break; + + case 'G': + m_GeneratorChoiceString = GetStringParam(value.c_str()); + break; + + case 'Q': + m_ExitAfterLoad = true; + break; + + case 'H': + m_WhereSource = value; + break; + } } - else +} + +// When the string param given has string quotes around it +// we remove them and we pass back the string. If not, we +// simply pass back the string as-is +wxString cmCommandLineInfo::GetStringParam(const char *pString) +{ + wxCHECK(pString, wxEmptyString); + + wxString str(pString); + str = str.Strip(wxString::both); + + // if we have only one (or no chars return the current string) + if(str.Len() < 2) + return str; + + // if we have quotes + if(str.GetChar(0) == '\"' && str.Last() == '\"') { - std::string sParam(parameter.c_str(), 1, parameter.npos); - // Single letter valued flag like /B=value or /B:value - std::string value; - if (sParam[1] == '=' || sParam[1] == ':') - { - value = std::string(parameter.c_str()+3); - } - else - { - value = std::string(parameter.c_str()+2); - } - int res; - switch (sParam[0]) - { - case 'A': - res = cmCommandLineInfo::GetBoolValue(value); - if (res == 1) - { - this->m_AdvancedValues = true; - } - else if (res == -1) - { - this->m_AdvancedValues = false; - } - break; - case 'B': - this->m_WhereBuild = value; - break; - case 'G': - this->m_GeneratorChoiceString = value; - break; - case 'Q': - this->m_ExitAfterLoad = true; - break; - case 'H': - this->m_WhereSource = value; - break; - } + // when we only have 2 in size, return empty string + if(str.Len() == 2) + return wxEmptyString; + + // now remove the outer and inner, and return + return str.Mid(1, str.Len()-1); } + + return str; } diff --git a/Source/WXDialog/CommandLineInfo.h b/Source/WXDialog/CommandLineInfo.h index a904bbc..f72a148 100644 --- a/Source/WXDialog/CommandLineInfo.h +++ b/Source/WXDialog/CommandLineInfo.h @@ -48,7 +48,7 @@ public: std::string m_WhereSource; std::string m_WhereBuild; bool m_AdvancedValues; - std::string m_GeneratorChoiceString; + wxString m_GeneratorChoiceString; std::string m_LastUnknownParameter; std::string m_ExecutablePath; bool m_ExitAfterLoad; @@ -60,6 +60,10 @@ protected: // Return boolean value of the string static int GetBoolValue(const std::string&); + // on windows the argument with spaces SUCKS! So we need to + // incorporate it with quotes. + wxString GetStringParam(const char *pString); + std::string m_ValidArguments; }; diff --git a/Source/WXDialog/cmakesetup.xml b/Source/WXDialog/cmakesetup.xml index c8e3b78..027fcb8 100644 --- a/Source/WXDialog/cmakesetup.xml +++ b/Source/WXDialog/cmakesetup.xml @@ -1,11 +1,12 @@ - +