diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-09-06 21:28:24 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-09-06 21:28:24 (GMT) |
commit | d204791e45b245fd0a10b2b31ab6ace9a8c3cf65 (patch) | |
tree | 183547168a76c000f332f7bad6b77a43f309a09d /Source/MFCDialog | |
parent | ecd4acfb01035d227f68c29ce0f65b2193bbd410 (diff) | |
download | CMake-d204791e45b245fd0a10b2b31ab6ace9a8c3cf65.zip CMake-d204791e45b245fd0a10b2b31ab6ace9a8c3cf65.tar.gz CMake-d204791e45b245fd0a10b2b31ab6ace9a8c3cf65.tar.bz2 |
ENH: integrate borland support
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r-- | Source/MFCDialog/CMakeSetup.rc | 24 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 48 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.h | 3 | ||||
-rw-r--r-- | Source/MFCDialog/resource.h | 4 |
4 files changed, 66 insertions, 13 deletions
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc index 20ca197..6cbe57e 100644 --- a/Source/MFCDialog/CMakeSetup.rc +++ b/Source/MFCDialog/CMakeSetup.rc @@ -85,32 +85,34 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END -IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 376, 225 +IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 389, 225 STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "CMakeSetupDialog" FONT 8, "MS Sans Serif" BEGIN - COMBOBOX IDC_WhereSource,147,6,135,66,CBS_DROPDOWN | + COMBOBOX IDC_WhereSource,96,6,133,66,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Browse...",IDC_BUTTON2,286,5,43,13 - COMBOBOX IDC_WhereBuild,148,26,133,68,CBS_DROPDOWN | + PUSHBUTTON "Browse...",IDC_BUTTON2,230,6,34,13 + COMBOBOX IDC_WhereBuild,96,26,133,68,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Browse...",IDC_BUTTON3,286,25,43,13 + PUSHBUTTON "Browse...",IDC_BUTTON3,230,25,34,13 DEFPUSHBUTTON "Configure",IDC_BuildProjects,88,202,67,15 PUSHBUTTON "Cancel",IDCANCEL,220,201,67,15 - LISTBOX IDC_LIST2,15,55,344,122,LBS_OWNERDRAWVARIABLE | + LISTBOX IDC_LIST2,15,55,356,122,LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL - RTEXT "Where is the source code:",IDC_STATIC,52,6,86,9 - RTEXT "Where do you want to build the binaries:",IDC_STATIC,10, - 27,128,9 - GROUPBOX "Cache Values",IDC_FRAME,9,43,356,141 + RTEXT "Where is the source code:",IDC_STATIC,6,7,86,9 + RTEXT "Where to build the binaries:",IDC_STATIC,5,27,90,9 + GROUPBOX "Cache Values",IDC_FRAME,9,43,369,141 CTEXT "Right click on cache entries for additional options", IDC_MouseHelpCaption,106,189,156,8 LTEXT "Static",IDC_CMAKE_VERSION,3,211,58,13,SS_CENTERIMAGE PUSHBUTTON "OK",IDC_OK,160,202,56,14 + COMBOBOX IDC_Generator,275,25,103,50,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Build For:",IDC_GeneratorLabel,279,10,103,12 END @@ -175,7 +177,7 @@ BEGIN IDD_CMakeSetupDialog_DIALOG, DIALOG BEGIN - RIGHTMARGIN, 375 + RIGHTMARGIN, 388 END END #endif // APSTUDIO_INVOKED diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index d66f8aa..ebb2c02 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -8,6 +8,7 @@ #include "CMakeCommandLineInfo.h" #include "../cmCacheManager.h" #include "../cmake.h" +#include "../cmMakefileGenerator.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -72,6 +73,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, //{{AFX_DATA_INIT(CMakeSetupDialog) m_WhereSource = cmdInfo.m_WhereSource; m_WhereBuild = cmdInfo.m_WhereBuild; + m_GeneratorChoiceString = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); @@ -92,6 +94,7 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CMakeSetupDialog) + DDX_Control(pDX, IDC_Generator, m_GeneratorChoice); DDX_Control(pDX, IDC_OK, m_OKButton); DDX_Control(pDX, IDCANCEL, m_CancelButton); DDX_CBStringExact(pDX, IDC_WhereSource, m_WhereSource); @@ -103,6 +106,7 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_MouseHelpCaption, m_MouseHelp); DDX_Control(pDX, IDC_CMAKE_VERSION, m_VersionDisplay); DDX_Control(pDX, IDC_BuildProjects, m_Configure); + DDX_CBStringExact(pDX, IDC_Generator, m_GeneratorChoiceString); //}}AFX_DATA_MAP } @@ -120,8 +124,9 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog) ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource) ON_WM_SIZE() ON_WM_GETMINMAXINFO() - ON_BN_CLICKED(IDCANCEL, OnCancel) ON_BN_CLICKED(IDC_OK, OnOk) + ON_BN_CLICKED(IDCANCEL, OnCancel) + ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -156,10 +161,22 @@ BOOL CMakeSetupDialog::OnInitDialog() SetIcon(m_hIcon, FALSE); // Set small icon // Load source and build dirs from registry this->LoadFromRegistry(); + cmake m; // force a register of generators + std::vector<std::string> names; + cmMakefileGenerator::GetRegisteredGenerators(names); + for(std::vector<std::string>::iterator i = names.begin(); + i != names.end(); ++i) + { + m_GeneratorChoice.AddString(i->c_str()); + } + m_GeneratorChoiceString = "Visual Studio 6"; + // try to load the cmake cache from disk this->LoadCacheFromDiskToGUI(); m_WhereBuildControl.LimitText(2048); m_WhereSourceControl.LimitText(2048); + m_GeneratorChoice.LimitText(2048); + // Set the version number char tmp[1024]; sprintf(tmp,"Version %d.%d", cmMakefile::GetMajorVersion(), @@ -435,6 +452,9 @@ void CMakeSetupDialog::RunCMake(bool generateProjectFiles) arg = "-B"; arg += m_WhereBuild; args.push_back(arg); + arg = "-G"; + arg += m_GeneratorChoiceString; + args.push_back(arg); // run the generate process if(make.Generate(args, generateProjectFiles) != 0) { @@ -617,6 +637,26 @@ void CMakeSetupDialog::LoadCacheFromDiskToGUI() { cmCacheManager::GetInstance()->LoadCache(m_WhereBuild); this->FillCacheGUIFromCacheManager(); + if(cmCacheManager::GetInstance()->GetCacheEntry("CMAKE_GENERATOR")) + { + std::string curGen = + cmCacheManager::GetInstance()->GetCacheEntry("CMAKE_GENERATOR")->m_Value; + if(m_GeneratorChoiceString != curGen.c_str()) + { + m_GeneratorChoiceString = curGen.c_str(); + this->UpdateData(FALSE); + // m_GeneratorChoice.SetWindowText(m_GeneratorChoiceString); +// int c = m_GeneratorChoice.GetCount(); +// int j = m_GeneratorChoice.FindStringExact(0, curGen.c_str()); +// if (j != CB_ERR) +// { +// m_GeneratorChoice.SetCurSel(j); +// } + +// m_GeneratorChoice.SelectString(0, curGen.c_str()); +// this->UpdateData(FALSE); + } + } } } @@ -735,3 +775,9 @@ void CMakeSetupDialog::OnOk() this->RunCMake(true); CDialog::OnOK(); } + +void CMakeSetupDialog::OnEditchangeGenerator() +{ + // TODO: Add your control notification handler code here + +} diff --git a/Source/MFCDialog/CMakeSetupDialog.h b/Source/MFCDialog/CMakeSetupDialog.h index f2fdd9d..7cac124 100644 --- a/Source/MFCDialog/CMakeSetupDialog.h +++ b/Source/MFCDialog/CMakeSetupDialog.h @@ -36,6 +36,7 @@ protected: // Dialog Data //{{AFX_DATA(CMakeSetupDialog) enum { IDD = IDD_CMakeSetupDialog_DIALOG }; + CComboBox m_GeneratorChoice; CButton m_OKButton; CButton m_CancelButton; CString m_WhereSource; @@ -48,6 +49,7 @@ protected: CStatic m_MouseHelp; CStatic m_VersionDisplay; CButton m_Configure; + CString m_GeneratorChoiceString; //}}AFX_DATA // ClassWizard generated virtual function overrides @@ -85,6 +87,7 @@ protected: afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ); afx_msg void OnOk(); + afx_msg void OnEditchangeGenerator(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Source/MFCDialog/resource.h b/Source/MFCDialog/resource.h index b899c8b..69dfa66 100644 --- a/Source/MFCDialog/resource.h +++ b/Source/MFCDialog/resource.h @@ -18,6 +18,8 @@ #define IDC_FRAME 1015 #define IDC_MouseHelpCaption 1016 #define IDC_OK 1018 +#define IDC_Generator 1019 +#define IDC_GeneratorLabel 1020 // Next default values for new objects // @@ -25,7 +27,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 133 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1019 +#define _APS_NEXT_CONTROL_VALUE 1021 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif |