summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2000-08-29 19:26:29 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2000-08-29 19:26:29 (GMT)
commit1f42f521cea8b953f4ad7ef5ca0d4c6d49c42a88 (patch)
treea7b88a2e4397167c0d6c72c9cf0fcf8f91dcd024 /Source/MFCDialog
parentd6bdba1096f36268e414f32829e22159e983031a (diff)
downloadCMake-1f42f521cea8b953f4ad7ef5ca0d4c6d49c42a88.zip
CMake-1f42f521cea8b953f4ad7ef5ca0d4c6d49c42a88.tar.gz
CMake-1f42f521cea8b953f4ad7ef5ca0d4c6d49c42a88.tar.bz2
NEW: move from tools and config to create CMake
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r--Source/MFCDialog/CMakeDialog.cpp327
-rw-r--r--Source/MFCDialog/CMakeDialog.h62
-rw-r--r--Source/MFCDialog/CMakeSetup.cpp74
-rw-r--r--Source/MFCDialog/CMakeSetup.dsp236
-rw-r--r--Source/MFCDialog/CMakeSetup.h49
-rw-r--r--Source/MFCDialog/CMakeSetup.rc212
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp326
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.h62
-rw-r--r--Source/MFCDialog/StdAfx.cpp8
-rw-r--r--Source/MFCDialog/StdAfx.h27
-rw-r--r--Source/MFCDialog/res/CMakeSetupDialog.icobin0 -> 1078 bytes
-rw-r--r--Source/MFCDialog/res/CMakeSetupDialog.rc213
-rw-r--r--Source/MFCDialog/resource.h24
13 files changed, 1420 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeDialog.cpp b/Source/MFCDialog/CMakeDialog.cpp
new file mode 100644
index 0000000..373ad47
--- /dev/null
+++ b/Source/MFCDialog/CMakeDialog.cpp
@@ -0,0 +1,327 @@
+// CMakeSetupDialogDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "pcbuilder.h"
+#include "CMakeSetupDialog.h"
+#include "../itkDSWBuilder.h"
+#include "../itkVC60Configure.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+ CAboutDlg();
+
+// Dialog Data
+ //{{AFX_DATA(CAboutDlg)
+ enum { IDD = IDD_ABOUTBOX };
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CAboutDlg)
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ //{{AFX_MSG(CAboutDlg)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+ };
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+ //{{AFX_DATA_INIT(CAboutDlg)
+ //}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CAboutDlg)
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+ //{{AFX_MSG_MAP(CAboutDlg)
+ // No message handlers
+ //}}AFX_MSG_MAP
+ END_MESSAGE_MAP();
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog dialog
+
+CMakeSetupDialog::CMakeSetupDialog(CWnd* pParent /*=NULL*/)
+ : CDialog(CMakeSetupDialog::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CMakeSetupDialog)
+ m_WhereITK = _T("");
+ m_WhereBuildITK = _T("");
+ //}}AFX_DATA_INIT
+ // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
+ m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+ m_WhereITK = _T("");
+ this->LoadFromRegistry();
+}
+
+void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CMakeSetupDialog)
+ DDX_Text(pDX, IDC_WhereITK, m_WhereITK);
+ DDX_Text(pDX, IDC_WhereITK2, m_WhereBuildITK);
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
+ //{{AFX_MSG_MAP(CMakeSetupDialog)
+ ON_WM_SYSCOMMAND()
+ ON_WM_PAINT()
+ ON_WM_QUERYDRAGICON()
+ ON_EN_CHANGE(IDC_WhereITK, OnChangeEdit1)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBrowse)
+ ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
+ //}}AFX_MSG_MAP
+ END_MESSAGE_MAP();
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog message handlers
+
+BOOL CMakeSetupDialog::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // Add "About..." menu item to system menu.
+
+ // IDM_ABOUTBOX must be in the system command range.
+ ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+ ASSERT(IDM_ABOUTBOX < 0xF000);
+
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu != NULL)
+ {
+ CString strAboutMenu;
+ strAboutMenu.LoadString(IDS_ABOUTBOX);
+ if (!strAboutMenu.IsEmpty())
+ {
+ pSysMenu->AppendMenu(MF_SEPARATOR);
+ pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+ }
+ }
+
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
+
+ // TODO: Add extra initialization here
+
+ return TRUE; // return TRUE unless you set the focus to a control
+}
+
+void CMakeSetupDialog::OnSysCommand(UINT nID, LPARAM lParam)
+{
+ if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+ {
+ CAboutDlg dlgAbout;
+ dlgAbout.DoModal();
+ }
+ else
+ {
+ CDialog::OnSysCommand(nID, lParam);
+ }
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+// to draw the icon. For MFC applications using the document/view model,
+// this is automatically done for you by the framework.
+
+void CMakeSetupDialog::OnPaint()
+{
+ if (IsIconic())
+ {
+ CPaintDC dc(this); // device context for painting
+
+ SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+ // Center icon in client rectangle
+ int cxIcon = GetSystemMetrics(SM_CXICON);
+ int cyIcon = GetSystemMetrics(SM_CYICON);
+ CRect rect;
+ GetClientRect(&rect);
+ int x = (rect.Width() - cxIcon + 1) / 2;
+ int y = (rect.Height() - cyIcon + 1) / 2;
+
+ // Draw the icon
+ dc.DrawIcon(x, y, m_hIcon);
+ }
+ else
+ {
+ CDialog::OnPaint();
+ }
+}
+
+// The system calls this to obtain the cursor to display while the user drags
+// the minimized window.
+HCURSOR CMakeSetupDialog::OnQueryDragIcon()
+{
+ return (HCURSOR) m_hIcon;
+}
+
+void CMakeSetupDialog::OnChangeEdit1()
+{
+ // TODO: If this is a RICHEDIT control, the control will not
+ // send this notification unless you override the CDialog::OnInitDialog()
+ // function and call CRichEditCtrl().SetEventMask()
+ // with the ENM_CHANGE flag ORed into the mask.
+
+ // TODO: Add your control notification handler code here
+
+}
+
+void CMakeSetupDialog::OnBrowse()
+{
+ this->UpdateData();
+ Browse(m_WhereITK, "Enter Path to Insight Source");
+ this->UpdateData(false);
+}
+
+bool CMakeSetupDialog::Browse(CString &result, const char *title)
+{
+// don't know what to do with initial right now...
+ char szPathName[4096];
+ BROWSEINFO bi;
+
+ bi.hwndOwner = m_hWnd;
+ bi.pidlRoot = NULL;
+ bi.pszDisplayName = (LPTSTR)szPathName;
+ bi.lpszTitle = title;
+ bi.ulFlags = BIF_BROWSEINCLUDEFILES ;
+ bi.lpfn = NULL;
+
+ LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
+
+ bool bSuccess = (bool)SHGetPathFromIDList(pidl, szPathName);
+ if(bSuccess)
+ {
+ result = szPathName;
+ }
+
+ return bSuccess;
+}
+
+void CMakeSetupDialog::OnOK()
+{
+ // get all the info from the screen
+ this->UpdateData();
+
+ // configure the system for VC60
+ itkVC60Configure config;
+ config.SetWhereITK(m_WhereITK);
+ config.SetWhereBuildITK(m_WhereBuildITK);
+ config.Configure();
+
+ itkDSWBuilder builder;
+ // Set the ITK home directory
+ builder.SetHomeDirectory(m_WhereITK);
+ // Set the Makefile.in file
+ CString makefileIn = m_WhereITK;
+ makefileIn += "/Makefile.in";
+ builder.SetInputMakefilePath(makefileIn);
+ // Set the output directory
+ builder.SetOutputDirectory(m_WhereBuildITK);
+ // set the directory which contains the Makefile.in
+ builder.SetMakefileDirectory(m_WhereITK);
+ // Create the master DSW file and all children dsp files for ITK
+ builder.CreateDSWFile();
+ CDialog::OnOK();
+ this->SaveToRegistry();
+}
+
+void CMakeSetupDialog::OnButton3()
+{
+ this->UpdateData();
+ Browse(m_WhereBuildITK, "Enter Path to Insight Build");
+ this->UpdateData(false);
+}
+
+void CMakeSetupDialog::SaveToRegistry()
+{
+ HKEY hKey;
+ DWORD dwDummy;
+
+ if(RegCreateKeyEx(HKEY_CURRENT_USER,
+ _T("Software\\Kitware\\ITK PCBuilder\\Settings"),
+ 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
+ NULL, &hKey, &dwDummy) != ERROR_SUCCESS)
+ {
+ return;
+ }
+ else
+ {
+ RegSetValueEx(hKey, _T("WhereITK"), 0, REG_SZ,
+ (CONST BYTE *)(const char *)m_WhereITK,
+ m_WhereITK.GetLength());
+ RegSetValueEx(hKey, _T("WhereBuildITK"), 0, REG_SZ,
+ (CONST BYTE *)(const char *)m_WhereBuildITK,
+ m_WhereBuildITK.GetLength());
+
+ }
+ RegCloseKey(hKey);
+}
+
+
+void CMakeSetupDialog::ReadRegistryValue(HKEY hKey,
+ CString *val,
+ char *key,
+ char *adefault)
+{
+ DWORD dwType, dwSize;
+ char *pb;
+
+ dwType = REG_SZ;
+ pb = val->GetBuffer(MAX_PATH);
+ dwSize = MAX_PATH;
+ if(RegQueryValueEx(hKey,_T(key), NULL, &dwType,
+ (BYTE *)pb, &dwSize) != ERROR_SUCCESS)
+ {
+ val->ReleaseBuffer();
+ *val = _T(adefault);
+ }
+ else
+ {
+ val->ReleaseBuffer();
+ }
+}
+
+
+void CMakeSetupDialog::LoadFromRegistry()
+{
+ HKEY hKey;
+ if(RegOpenKeyEx(HKEY_CURRENT_USER,
+ _T("Software\\Kitware\\ITK PCBuilder\\Settings"),
+ 0, KEY_READ, &hKey) != ERROR_SUCCESS)
+ {
+ return;
+ }
+ else
+ {
+ // save some values
+ this->ReadRegistryValue(hKey, &(m_WhereITK),"WhereITK","C:\\Insight");
+ this->ReadRegistryValue(hKey, &(m_WhereBuildITK),"WhereBuildITK",
+ "C:\\vtkbin");
+ }
+ RegCloseKey(hKey);
+}
diff --git a/Source/MFCDialog/CMakeDialog.h b/Source/MFCDialog/CMakeDialog.h
new file mode 100644
index 0000000..9e491bd
--- /dev/null
+++ b/Source/MFCDialog/CMakeDialog.h
@@ -0,0 +1,62 @@
+// CMakeSetupDialogDlg.h : header file
+//
+
+#if !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
+#define AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog dialog
+
+class CMakeSetupDialog : public CDialog
+{
+// Construction
+public:
+ CMakeSetupDialog(CWnd* pParent = NULL); // standard constructor
+protected:
+ bool Browse(CString&, const char* title);
+ void SaveToRegistry();
+ void LoadFromRegistry();
+ void ReadRegistryValue(HKEY hKey,
+ CString *val,
+ char *key,
+ char *adefault);
+// Dialog Data
+ //{{AFX_DATA(CMakeSetupDialog)
+ enum { IDD = IDD_CMakeSetupDialog_DIALOG };
+ CString m_WhereITK;
+ CString m_WhereBuildITK;
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CMakeSetupDialog)
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ HICON m_hIcon;
+
+ // Generated message map functions
+ //{{AFX_MSG(CMakeSetupDialog)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+ afx_msg void OnPaint();
+ afx_msg HCURSOR OnQueryDragIcon();
+ afx_msg void OnChangeEdit1();
+ afx_msg void OnBrowse();
+ virtual void OnOK();
+ afx_msg void OnButton3();
+
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/CMakeSetup.cpp b/Source/MFCDialog/CMakeSetup.cpp
new file mode 100644
index 0000000..22aa238
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetup.cpp
@@ -0,0 +1,74 @@
+// CMakeSetupdialog.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "CMakeSetup.h"
+#include "CMakeSetupDialog.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetup
+
+BEGIN_MESSAGE_MAP(CMakeSetup, CWinApp)
+ //{{AFX_MSG_MAP(CMakeSetup)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG
+ ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+ END_MESSAGE_MAP();
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetup construction
+CMakeSetup::CMakeSetup()
+{
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CMakeSetup object
+
+CMakeSetup theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetup initialization
+
+BOOL CMakeSetup::InitInstance()
+{
+ AfxEnableControlContainer();
+
+ // Standard initialization
+ // If you are not using these features and wish to reduce the size
+ // of your final executable, you should remove from the following
+ // the specific initialization routines you do not need.
+
+#ifdef _AFXDLL
+ Enable3dControls(); // Call this when using MFC in a shared DLL
+#else
+ Enable3dControlsStatic(); // Call this when linking to MFC statically
+#endif
+
+ CMakeSetupDialog dlg;
+ m_pMainWnd = &dlg;
+ int nResponse = dlg.DoModal();
+ if (nResponse == IDOK)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with OK
+ }
+ else if (nResponse == IDCANCEL)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with Cancel
+ }
+
+ // Since the dialog has been closed, return FALSE so that we exit the
+ // application, rather than start the application's message pump.
+ return FALSE;
+}
diff --git a/Source/MFCDialog/CMakeSetup.dsp b/Source/MFCDialog/CMakeSetup.dsp
new file mode 100644
index 0000000..6ab7031
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetup.dsp
@@ -0,0 +1,236 @@
+# Microsoft Developer Studio Project File - Name="CMakeSetup" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=CMakeSetup - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "CMakeSetup.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "CMakeSetup.mak" CFG="CMakeSetup - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "CMakeSetup - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "CMakeSetup - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "CMakeSetup - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".."
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "CMakeSetup - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".."
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "CMakeSetup - Win32 Release"
+# Name "CMakeSetup - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\cmClassFile.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSPBuilder.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSPMakefile.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSWBuilder.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSWMakefile.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmMakeDepend.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmMakefile.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmPCBuilder.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmRegularExpression.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmSystemTools.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\itkVC60Configure.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmWindowsConfigure.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=.\CMakeSetup.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CMakeSetup.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\CMakeSetupDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\cmClassFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSPBuilder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSPMakefile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSWBuilder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmDSWMakefile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmMakeDepend.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmMakefile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\CMakeSetup.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\cmRegularExpression.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CMakeSetup.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CMakeSetupDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\CMakeSetup.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\CMakeSetupDialog.rc2
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\CMakeSetupDialog.ico
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
diff --git a/Source/MFCDialog/CMakeSetup.h b/Source/MFCDialog/CMakeSetup.h
new file mode 100644
index 0000000..bcd21d7
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetup.h
@@ -0,0 +1,49 @@
+// CMakeSetupdialog.h : main header file for the CMakeSetupDIALOG application
+//
+
+#if !defined(AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
+#define AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetup:
+// See CMakeSetupdialog.cpp for the implementation of this class
+//
+
+class CMakeSetup : public CWinApp
+{
+public:
+ CMakeSetup();
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CMakeSetup)
+public:
+ virtual BOOL InitInstance();
+ //}}AFX_VIRTUAL
+
+// Implementation
+
+ //{{AFX_MSG(CMakeSetup)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ // DO NOT EDIT what you see in these blocks of generated code !
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc
new file mode 100644
index 0000000..14794cb
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetup.rc
@@ -0,0 +1,212 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif //_WIN32\r\n"
+ "#include ""res\\CMakeSetupDialog.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME ICON DISCARDABLE "res\\CMakeSetupDialog.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About CMakeSetup"
+FONT 8, "MS Sans Serif"
+BEGIN
+ ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+ LTEXT "CMakeSetup Version 1.0",IDC_STATIC,40,10,119,8,
+ SS_NOPREFIX
+ LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8
+ DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
+END
+
+IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 320, 200
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "CMakeSetupDialog"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,260,7,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,260,23,50,14
+ EDITTEXT IDC_WhereSource,13,27,135,13,ES_AUTOHSCROLL
+ PUSHBUTTON "Browse...",IDC_BUTTON2,150,28,43,13
+ LTEXT "Where is the Insight Source",IDC_STATIC,14,15,104,9
+ EDITTEXT IDC_WhereBuild,16,67,133,13,ES_AUTOHSCROLL
+ PUSHBUTTON "Browse...",IDC_BUTTON3,151,66,43,13
+ LTEXT "Where do you want to build the binaries",IDC_STATIC,16,
+ 56,128,9
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "CMakeSetup MFC Application\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "CMakeSetup\0"
+ VALUE "LegalCopyright", "Copyright (C) 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "CMakeSetup.EXE\0"
+ VALUE "ProductName", "CMakeSetup Application\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_ABOUTBOX, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 228
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 48
+ END
+
+ IDD_CMAKESETUPDIALOG_DIALOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 313
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 193
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_ABOUTBOX "&About CMakeSetup..."
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res\CMakeSetupDialog.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
new file mode 100644
index 0000000..13513b29
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -0,0 +1,326 @@
+// pcbuilderdialogDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "CMakeSetup.h"
+#include "CMakeSetupDialog.h"
+#include "../cmDSWBuilder.h"
+#include "../itkVC60Configure.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+ CAboutDlg();
+
+// Dialog Data
+ //{{AFX_DATA(CAboutDlg)
+ enum { IDD = IDD_ABOUTBOX };
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CAboutDlg)
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ //{{AFX_MSG(CAboutDlg)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+ };
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+ //{{AFX_DATA_INIT(CAboutDlg)
+ //}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CAboutDlg)
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+ //{{AFX_MSG_MAP(CAboutDlg)
+ // No message handlers
+ //}}AFX_MSG_MAP
+ END_MESSAGE_MAP();
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog dialog
+
+CMakeSetupDialog::CMakeSetupDialog(CWnd* pParent /*=NULL*/)
+ : CDialog(CMakeSetupDialog::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CMakeSetupDialog)
+ m_WhereSource = _T("");
+ m_WhereBuild = _T("");
+ //}}AFX_DATA_INIT
+ // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
+ m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+ m_WhereSource = _T("");
+ this->LoadFromRegistry();
+}
+
+void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CMakeSetupDialog)
+ DDX_Text(pDX, IDC_WhereSource, m_WhereSource);
+ DDX_Text(pDX, IDC_WhereBuild, m_WhereBuild);
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
+ //{{AFX_MSG_MAP(CMakeSetupDialog)
+ ON_WM_SYSCOMMAND()
+ ON_WM_PAINT()
+ ON_WM_QUERYDRAGICON()
+ ON_EN_CHANGE(IDC_WhereSource, OnChangeEdit1)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBrowse)
+ ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
+ //}}AFX_MSG_MAP
+ END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog message handlers
+
+ BOOL CMakeSetupDialog::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // Add "About..." menu item to system menu.
+
+ // IDM_ABOUTBOX must be in the system command range.
+ ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+ ASSERT(IDM_ABOUTBOX < 0xF000);
+
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu != NULL)
+ {
+ CString strAboutMenu;
+ strAboutMenu.LoadString(IDS_ABOUTBOX);
+ if (!strAboutMenu.IsEmpty())
+ {
+ pSysMenu->AppendMenu(MF_SEPARATOR);
+ pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
+ }
+ }
+
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
+
+ // TODO: Add extra initialization here
+
+ return TRUE; // return TRUE unless you set the focus to a control
+}
+
+void CMakeSetupDialog::OnSysCommand(UINT nID, LPARAM lParam)
+{
+ if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+ {
+ CAboutDlg dlgAbout;
+ dlgAbout.DoModal();
+ }
+ else
+ {
+ CDialog::OnSysCommand(nID, lParam);
+ }
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+// to draw the icon. For MFC applications using the document/view model,
+// this is automatically done for you by the framework.
+
+void CMakeSetupDialog::OnPaint()
+{
+ if (IsIconic())
+ {
+ CPaintDC dc(this); // device context for painting
+
+ SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+ // Center icon in client rectangle
+ int cxIcon = GetSystemMetrics(SM_CXICON);
+ int cyIcon = GetSystemMetrics(SM_CYICON);
+ CRect rect;
+ GetClientRect(&rect);
+ int x = (rect.Width() - cxIcon + 1) / 2;
+ int y = (rect.Height() - cyIcon + 1) / 2;
+
+ // Draw the icon
+ dc.DrawIcon(x, y, m_hIcon);
+ }
+ else
+ {
+ CDialog::OnPaint();
+ }
+}
+
+// The system calls this to obtain the cursor to display while the user drags
+// the minimized window.
+HCURSOR CMakeSetupDialog::OnQueryDragIcon()
+{
+ return (HCURSOR) m_hIcon;
+}
+
+void CMakeSetupDialog::OnChangeEdit1()
+{
+ // TODO: If this is a RICHEDIT control, the control will not
+ // send this notification unless you override the CDialog::OnInitDialog()
+ // function and call CRichEditCtrl().SetEventMask()
+ // with the ENM_CHANGE flag ORed into the mask.
+
+ // TODO: Add your control notification handler code here
+
+}
+
+void CMakeSetupDialog::OnBrowse()
+{
+ this->UpdateData();
+ Browse(m_WhereSource, "Enter Path to Insight Source");
+ this->UpdateData(false);
+}
+
+bool CMakeSetupDialog::Browse(CString &result, const char *title)
+{
+// don't know what to do with initial right now...
+ char szPathName[4096];
+ BROWSEINFO bi;
+
+ bi.hwndOwner = m_hWnd;
+ bi.pidlRoot = NULL;
+ bi.pszDisplayName = (LPTSTR)szPathName;
+ bi.lpszTitle = title;
+ bi.ulFlags = BIF_BROWSEINCLUDEFILES ;
+ bi.lpfn = NULL;
+
+ LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
+
+ bool bSuccess = (bool)SHGetPathFromIDList(pidl, szPathName);
+ if(bSuccess)
+ {
+ result = szPathName;
+ }
+
+ return bSuccess;
+}
+
+void CMakeSetupDialog::OnOK()
+{
+ // get all the info from the screen
+ this->UpdateData();
+
+ // configure the system for VC60
+ itkVC60Configure config;
+ config.SetWhereSource(m_WhereSource);
+ config.SetWhereBuild(m_WhereBuild);
+ config.Configure();
+
+ cmDSWBuilder builder;
+ // Set the ITK home directory
+ builder.SetHomeDirectory(m_WhereSource);
+ // Set the Makefile.in file
+ CString makefileIn = m_WhereSource;
+ makefileIn += "/Makefile.in";
+ builder.SetInputMakefilePath(makefileIn);
+ // Set the output directory
+ builder.SetOutputDirectory(m_WhereBuild);
+ // set the directory which contains the Makefile.in
+ builder.SetMakefileDirectory(m_WhereSource);
+ // Create the master DSW file and all children dsp files for ITK
+ builder.CreateDSWFile();
+ CDialog::OnOK();
+ this->SaveToRegistry();
+}
+
+void CMakeSetupDialog::OnButton3()
+{
+ this->UpdateData();
+ Browse(m_WhereBuild, "Enter Path to Insight Build");
+ this->UpdateData(false);
+}
+
+void CMakeSetupDialog::SaveToRegistry()
+{
+ HKEY hKey;
+ DWORD dwDummy;
+
+ if(RegCreateKeyEx(HKEY_CURRENT_USER,
+ _T("Software\\Kitware\\CMakeSetup\\Settings"),
+ 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
+ NULL, &hKey, &dwDummy) != ERROR_SUCCESS)
+ {
+ return;
+ }
+ else
+ {
+ RegSetValueEx(hKey, _T("WhereSource"), 0, REG_SZ,
+ (CONST BYTE *)(const char *)m_WhereSource,
+ m_WhereSource.GetLength());
+ RegSetValueEx(hKey, _T("WhereBuild"), 0, REG_SZ,
+ (CONST BYTE *)(const char *)m_WhereBuild,
+ m_WhereBuild.GetLength());
+
+ }
+ RegCloseKey(hKey);
+}
+
+
+void CMakeSetupDialog::ReadRegistryValue(HKEY hKey,
+ CString *val,
+ char *key,
+ char *adefault)
+{
+ DWORD dwType, dwSize;
+ char *pb;
+
+ dwType = REG_SZ;
+ pb = val->GetBuffer(MAX_PATH);
+ dwSize = MAX_PATH;
+ if(RegQueryValueEx(hKey,_T(key), NULL, &dwType,
+ (BYTE *)pb, &dwSize) != ERROR_SUCCESS)
+ {
+ val->ReleaseBuffer();
+ *val = _T(adefault);
+ }
+ else
+ {
+ val->ReleaseBuffer();
+ }
+}
+
+
+void CMakeSetupDialog::LoadFromRegistry()
+{
+ HKEY hKey;
+ if(RegOpenKeyEx(HKEY_CURRENT_USER,
+ _T("Software\\Kitware\\CMakeSetup\\Settings"),
+ 0, KEY_READ, &hKey) != ERROR_SUCCESS)
+ {
+ return;
+ }
+ else
+ {
+ // save some values
+ this->ReadRegistryValue(hKey, &(m_WhereSource),"WhereSource","C:\\Insight");
+ this->ReadRegistryValue(hKey, &(m_WhereBuild),"WhereBuild",
+ "C:\\Insight");
+ }
+ RegCloseKey(hKey);
+}
diff --git a/Source/MFCDialog/CMakeSetupDialog.h b/Source/MFCDialog/CMakeSetupDialog.h
new file mode 100644
index 0000000..37d9ae0
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetupDialog.h
@@ -0,0 +1,62 @@
+// CMakeSetupDialogDlg.h : header file
+//
+
+#if !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
+#define AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/////////////////////////////////////////////////////////////////////////////
+// CMakeSetupDialog dialog
+
+class CMakeSetupDialog : public CDialog
+{
+// Construction
+public:
+ CMakeSetupDialog(CWnd* pParent = NULL); // standard constructor
+protected:
+ bool Browse(CString&, const char* title);
+ void SaveToRegistry();
+ void LoadFromRegistry();
+ void ReadRegistryValue(HKEY hKey,
+ CString *val,
+ char *key,
+ char *adefault);
+// Dialog Data
+ //{{AFX_DATA(CMakeSetupDialog)
+ enum { IDD = IDD_CMakeSetupDialog_DIALOG };
+ CString m_WhereSource;
+ CString m_WhereBuild;
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CMakeSetupDialog)
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ HICON m_hIcon;
+
+ // Generated message map functions
+ //{{AFX_MSG(CMakeSetupDialog)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+ afx_msg void OnPaint();
+ afx_msg HCURSOR OnQueryDragIcon();
+ afx_msg void OnChangeEdit1();
+ afx_msg void OnBrowse();
+ virtual void OnOK();
+ afx_msg void OnButton3();
+
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/StdAfx.cpp b/Source/MFCDialog/StdAfx.cpp
new file mode 100644
index 0000000..4ec72a4
--- /dev/null
+++ b/Source/MFCDialog/StdAfx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// pcbuilderdialog.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
diff --git a/Source/MFCDialog/StdAfx.h b/Source/MFCDialog/StdAfx.h
new file mode 100644
index 0000000..95ab6af
--- /dev/null
+++ b/Source/MFCDialog/StdAfx.h
@@ -0,0 +1,27 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
+#define AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h> // MFC core and standard components
+#include <afxext.h> // MFC extensions
+#include <afxdisp.h> // MFC Automation classes
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h> // MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/res/CMakeSetupDialog.ico b/Source/MFCDialog/res/CMakeSetupDialog.ico
new file mode 100644
index 0000000..7eef0bc
--- /dev/null
+++ b/Source/MFCDialog/res/CMakeSetupDialog.ico
Binary files differ
diff --git a/Source/MFCDialog/res/CMakeSetupDialog.rc2 b/Source/MFCDialog/res/CMakeSetupDialog.rc2
new file mode 100644
index 0000000..8a619b3
--- /dev/null
+++ b/Source/MFCDialog/res/CMakeSetupDialog.rc2
@@ -0,0 +1,13 @@
+//
+// PCBUILDERDIALOG.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/Source/MFCDialog/resource.h b/Source/MFCDialog/resource.h
new file mode 100644
index 0000000..51c21d9
--- /dev/null
+++ b/Source/MFCDialog/resource.h
@@ -0,0 +1,24 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by pcbuilder.rc
+//
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_CMakeSetupDialog_DIALOG 102
+#define IDR_MAINFRAME 128
+#define IDC_WhereSource 1001
+#define IDC_BUTTON2 1002
+#define IDC_WhereBuild 1003
+#define IDC_BUTTON3 1004
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1003
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif