CMakeSetupDialog.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. // pcbuilderdialogDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CMakeSetup.h"
  5. #include "CMakeSetupDialog.h"
  6. #include "../cmCacheManager.h"
  7. #include "../cmake.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CAboutDlg dialog used for App About
  15. class CAboutDlg : public CDialog
  16. {
  17. public:
  18. CAboutDlg();
  19. // Dialog Data
  20. //{{AFX_DATA(CAboutDlg)
  21. enum { IDD = IDD_ABOUTBOX };
  22. //}}AFX_DATA
  23. // ClassWizard generated virtual function overrides
  24. //{{AFX_VIRTUAL(CAboutDlg)
  25. protected:
  26. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  27. //}}AFX_VIRTUAL
  28. // Implementation
  29. protected:
  30. //{{AFX_MSG(CAboutDlg)
  31. //}}AFX_MSG
  32. DECLARE_MESSAGE_MAP()
  33. };
  34. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  35. {
  36. //{{AFX_DATA_INIT(CAboutDlg)
  37. //}}AFX_DATA_INIT
  38. }
  39. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  40. {
  41. CDialog::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(CAboutDlg)
  43. //}}AFX_DATA_MAP
  44. }
  45. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  46. //{{AFX_MSG_MAP(CAboutDlg)
  47. // No message handlers
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP();
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMakeSetupDialog dialog
  52. CMakeSetupDialog::CMakeSetupDialog(CWnd* pParent /*=NULL*/)
  53. : CDialog(CMakeSetupDialog::IDD, pParent)
  54. {
  55. m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
  56. //{{AFX_DATA_INIT(CMakeSetupDialog)
  57. m_WhereBuild = _T("");
  58. m_WhereSource = _T("");
  59. //}}AFX_DATA_INIT
  60. // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
  61. m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  62. m_BuildPathChanged = false;
  63. // Find the path to the cmake.exe executable
  64. char fname[1024];
  65. ::GetModuleFileName(NULL,fname,1023);
  66. // extract just the path part
  67. m_PathToExecutable = cmSystemTools::GetProgramPath(fname).c_str();
  68. // add the cmake.exe to the path
  69. m_PathToExecutable += "/cmake.exe";
  70. }
  71. void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
  72. {
  73. CDialog::DoDataExchange(pDX);
  74. //{{AFX_DATA_MAP(CMakeSetupDialog)
  75. DDX_Control(pDX, IDC_WhereSource, m_WhereSourceControl);
  76. DDX_Control(pDX, IDC_WhereBuild, m_WhereBuildControl);
  77. DDX_Control(pDX, IDC_LIST2, m_CacheEntriesList);
  78. DDX_CBString(pDX, IDC_WhereBuild, m_WhereBuild);
  79. DDX_CBString(pDX, IDC_WhereSource, m_WhereSource);
  80. //}}AFX_DATA_MAP
  81. }
  82. BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
  83. //{{AFX_MSG_MAP(CMakeSetupDialog)
  84. ON_WM_SYSCOMMAND()
  85. ON_WM_PAINT()
  86. ON_WM_QUERYDRAGICON()
  87. ON_BN_CLICKED(IDC_BuildProjects, OnBuildProjects)
  88. ON_BN_CLICKED(IDC_BUTTON2, OnBrowseWhereSource)
  89. ON_BN_CLICKED(IDC_BUTTON3, OnBrowseWhereBuild)
  90. ON_CBN_EDITCHANGE(IDC_WhereBuild, OnChangeWhereBuild)
  91. ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
  92. ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
  93. ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
  94. //}}AFX_MSG_MAP
  95. END_MESSAGE_MAP()
  96. /////////////////////////////////////////////////////////////////////////////
  97. // CMakeSetupDialog message handlers
  98. BOOL CMakeSetupDialog::OnInitDialog()
  99. {
  100. CDialog::OnInitDialog();
  101. // Add "About..." menu item to system menu.
  102. // IDM_ABOUTBOX must be in the system command range.
  103. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  104. ASSERT(IDM_ABOUTBOX < 0xF000);
  105. CMenu* pSysMenu = GetSystemMenu(FALSE);
  106. if (pSysMenu != NULL)
  107. {
  108. CString strAboutMenu;
  109. strAboutMenu.LoadString(IDS_ABOUTBOX);
  110. if (!strAboutMenu.IsEmpty())
  111. {
  112. pSysMenu->AppendMenu(MF_SEPARATOR);
  113. pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  114. }
  115. }
  116. // Set the icon for this dialog. The framework does this automatically
  117. // when the application's main window is not a dialog
  118. SetIcon(m_hIcon, TRUE); // Set big icon
  119. SetIcon(m_hIcon, FALSE); // Set small icon
  120. // Load source and build dirs from registry
  121. this->LoadFromRegistry();
  122. // try to load the cmake cache from disk
  123. this->LoadCacheFromDiskToGUI();
  124. m_WhereBuildControl.LimitText(2048);
  125. m_WhereSourceControl.LimitText(2048);
  126. // Set the version number
  127. char tmp[1024];
  128. sprintf(tmp,"Version %s", cmMakefile::GetVersion());
  129. SetDlgItemText(IDC_CMAKE_VERSION, tmp);
  130. this->UpdateData(FALSE);
  131. return TRUE; // return TRUE unless you set the focus to a control
  132. }
  133. // About dialog invoke
  134. void CMakeSetupDialog::OnSysCommand(UINT nID, LPARAM lParam)
  135. {
  136. if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  137. {
  138. CAboutDlg dlgAbout;
  139. dlgAbout.DoModal();
  140. }
  141. else
  142. {
  143. CDialog::OnSysCommand(nID, lParam);
  144. }
  145. }
  146. // If you add a minimize button to your dialog, you will need the code below
  147. // to draw the icon. For MFC applications using the document/view model,
  148. // this is automatically done for you by the framework.
  149. void CMakeSetupDialog::OnPaint()
  150. {
  151. if (IsIconic())
  152. {
  153. CPaintDC dc(this); // device context for painting
  154. SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
  155. // Center icon in client rectangle
  156. int cxIcon = GetSystemMetrics(SM_CXICON);
  157. int cyIcon = GetSystemMetrics(SM_CYICON);
  158. CRect rect;
  159. GetClientRect(&rect);
  160. int x = (rect.Width() - cxIcon + 1) / 2;
  161. int y = (rect.Height() - cyIcon + 1) / 2;
  162. // Draw the icon
  163. dc.DrawIcon(x, y, m_hIcon);
  164. }
  165. else
  166. {
  167. CDialog::OnPaint();
  168. }
  169. }
  170. // The system calls this to obtain the cursor to display while the user drags
  171. // the minimized window.
  172. HCURSOR CMakeSetupDialog::OnQueryDragIcon()
  173. {
  174. return (HCURSOR) m_hIcon;
  175. }
  176. // Insane Microsoft way of setting the initial directory
  177. // for the Shbrowseforfolder function...
  178. // SetSelProc
  179. // Callback procedure to set the initial selection of the browser.
  180. int CALLBACK CMakeSetupDialog_SetSelProc( HWND hWnd, UINT uMsg,
  181. LPARAM lParam, LPARAM lpData )
  182. {
  183. if (uMsg==BFFM_INITIALIZED)
  184. {
  185. ::SendMessage(hWnd, BFFM_SETSELECTION, TRUE, lpData );
  186. }
  187. return 0;
  188. }
  189. inline void ILFree(LPITEMIDLIST pidl)
  190. {
  191. LPMALLOC pMalloc;
  192. if (pidl)
  193. {
  194. SHGetMalloc(&pMalloc);
  195. pMalloc->Free( pidl);
  196. pMalloc->Release();
  197. }
  198. }
  199. // Browse button
  200. bool CMakeSetupDialog::Browse(CString &result, const char *title)
  201. {
  202. // don't know what to do with initial right now...
  203. char szPathName[4096];
  204. BROWSEINFO bi;
  205. bi.hwndOwner = m_hWnd;
  206. bi.pidlRoot = NULL;
  207. bi.pszDisplayName = (LPTSTR)szPathName;
  208. bi.lpszTitle = title;
  209. bi.ulFlags = BIF_BROWSEINCLUDEFILES;
  210. // set up initial directory code
  211. bi.lpfn = CMakeSetupDialog_SetSelProc;
  212. bi.lParam = (LPARAM)(LPCSTR) result;
  213. // open the directory chooser
  214. LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
  215. // get the result
  216. bool bSuccess = (SHGetPathFromIDList(pidl, szPathName) ? true : false);
  217. if(bSuccess)
  218. {
  219. result = szPathName;
  220. }
  221. ILFree(pidl);
  222. return bSuccess;
  223. }
  224. void CMakeSetupDialog::SaveToRegistry()
  225. {
  226. HKEY hKey;
  227. DWORD dwDummy;
  228. if(RegCreateKeyEx(HKEY_CURRENT_USER,
  229. m_RegistryKey,
  230. 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
  231. NULL, &hKey, &dwDummy) != ERROR_SUCCESS)
  232. {
  233. return;
  234. }
  235. else
  236. {
  237. // load some values
  238. CString regvalue;
  239. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource","C:\\");
  240. if(m_WhereSource != regvalue)
  241. {
  242. regvalue = "";
  243. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource3","");
  244. RegSetValueEx(hKey, _T("WhereSource4"), 0, REG_SZ,
  245. (CONST BYTE *)(const char *)regvalue,
  246. regvalue.GetLength());
  247. regvalue = "";
  248. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource2","");
  249. RegSetValueEx(hKey, _T("WhereSource3"), 0, REG_SZ,
  250. (CONST BYTE *)(const char *)regvalue,
  251. regvalue.GetLength());
  252. regvalue = "";
  253. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource","");
  254. RegSetValueEx(hKey, _T("WhereSource2"), 0, REG_SZ,
  255. (CONST BYTE *)(const char *)regvalue,
  256. regvalue.GetLength());
  257. RegSetValueEx(hKey, _T("WhereSource"), 0, REG_SZ,
  258. (CONST BYTE *)(const char *)m_WhereSource,
  259. m_WhereSource.GetLength());
  260. }
  261. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild","C:\\");
  262. if(m_WhereBuild != regvalue)
  263. {
  264. regvalue = "";
  265. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild3","");
  266. RegSetValueEx(hKey, _T("WhereBuild4"), 0, REG_SZ,
  267. (CONST BYTE *)(const char *)regvalue,
  268. regvalue.GetLength());
  269. regvalue = "";
  270. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild2","");
  271. RegSetValueEx(hKey, _T("WhereBuild3"), 0, REG_SZ,
  272. (CONST BYTE *)(const char *)regvalue,
  273. regvalue.GetLength());
  274. regvalue = "";
  275. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild","");
  276. RegSetValueEx(hKey, _T("WhereBuild2"), 0, REG_SZ,
  277. (CONST BYTE *)(const char *)regvalue,
  278. regvalue.GetLength());
  279. RegSetValueEx(hKey, _T("WhereBuild"), 0, REG_SZ,
  280. (CONST BYTE *)(const char *)m_WhereBuild,
  281. m_WhereBuild.GetLength());
  282. }
  283. }
  284. RegCloseKey(hKey);
  285. }
  286. void CMakeSetupDialog::ReadRegistryValue(HKEY hKey,
  287. CString *val,
  288. const char *key,
  289. const char *adefault)
  290. {
  291. DWORD dwType, dwSize;
  292. char *pb;
  293. dwType = REG_SZ;
  294. pb = val->GetBuffer(MAX_PATH);
  295. dwSize = MAX_PATH;
  296. if(RegQueryValueEx(hKey,_T(key), NULL, &dwType,
  297. (BYTE *)pb, &dwSize) != ERROR_SUCCESS)
  298. {
  299. val->ReleaseBuffer();
  300. *val = _T(adefault);
  301. }
  302. else
  303. {
  304. val->ReleaseBuffer();
  305. }
  306. }
  307. void CMakeSetupDialog::LoadFromRegistry()
  308. {
  309. HKEY hKey;
  310. if(RegOpenKeyEx(HKEY_CURRENT_USER,
  311. m_RegistryKey,
  312. 0, KEY_READ, &hKey) != ERROR_SUCCESS)
  313. {
  314. return;
  315. }
  316. else
  317. {
  318. // load some values
  319. this->ReadRegistryValue(hKey, &(m_WhereSource),"WhereSource","C:\\");
  320. this->ReadRegistryValue(hKey, &(m_WhereBuild),"WhereBuild","C:\\");
  321. m_WhereSourceControl.AddString(m_WhereSource);
  322. m_WhereBuildControl.AddString(m_WhereBuild);
  323. CString regvalue;
  324. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource2","C:\\");
  325. m_WhereSourceControl.AddString(regvalue);
  326. regvalue = "";
  327. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild2","C:\\");
  328. m_WhereBuildControl.AddString(regvalue);
  329. regvalue = "";
  330. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource3","C:\\");
  331. m_WhereSourceControl.AddString(regvalue);
  332. regvalue = "";
  333. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild3","C:\\");
  334. m_WhereBuildControl.AddString(regvalue);
  335. regvalue = "";
  336. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource4","C:\\");
  337. m_WhereSourceControl.AddString(regvalue);
  338. regvalue = "";
  339. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild4","C:\\");
  340. m_WhereBuildControl.AddString(regvalue);
  341. }
  342. RegCloseKey(hKey);
  343. }
  344. // Callback for browse source button
  345. void CMakeSetupDialog::OnBrowseWhereSource()
  346. {
  347. this->UpdateData();
  348. Browse(m_WhereSource, "Enter Path to Source");
  349. this->UpdateData(false);
  350. this->OnChangeWhereSource();
  351. }
  352. // Callback for browser build button
  353. void CMakeSetupDialog::OnBrowseWhereBuild()
  354. {
  355. this->UpdateData();
  356. Browse(m_WhereBuild, "Enter Path to Build");
  357. this->UpdateData(false);
  358. this->OnChangeWhereBuild();
  359. }
  360. // Callback for build projects button
  361. void CMakeSetupDialog::OnBuildProjects()
  362. {
  363. if(!cmSystemTools::FileExists(m_WhereBuild))
  364. {
  365. std::string message =
  366. "Build directory does not exist, should I create it?\n\n"
  367. "Directory: ";
  368. message += (const char*)m_WhereBuild;
  369. if(MessageBox(message.c_str(), "Create Directory", MB_OKCANCEL) == IDOK)
  370. {
  371. cmSystemTools::MakeDirectory(m_WhereBuild);
  372. }
  373. else
  374. {
  375. MessageBox("Build Project aborted, nothing done.");
  376. return;
  377. }
  378. }
  379. // set the wait cursor
  380. ::SetCursor(LoadCursor(NULL, IDC_WAIT));
  381. // get all the info from the dialog
  382. this->UpdateData();
  383. if(!m_BuildPathChanged)
  384. {
  385. // if the build path has not changed save the
  386. // current GUI values to the cache
  387. this->SaveCacheFromGUI();
  388. }
  389. // Make sure we are working from the cache on disk
  390. this->LoadCacheFromDiskToGUI();
  391. // create a cmake object
  392. cmake make;
  393. // create the arguments for the cmake object
  394. std::vector<std::string> args;
  395. args.push_back((const char*)m_PathToExecutable);
  396. std::string arg;
  397. arg = "-H";
  398. arg += m_WhereSource;
  399. args.push_back(arg);
  400. arg = "-B";
  401. arg += m_WhereBuild;
  402. args.push_back(arg);
  403. // run the generate process
  404. if(make.Generate(args) != 0)
  405. {
  406. cmSystemTools::Error(
  407. "Error in generation process, project files may be invalid");
  408. }
  409. // update the GUI with any new values in the caused by the
  410. // generation process
  411. this->LoadCacheFromDiskToGUI();
  412. // save source and build paths to registry
  413. this->SaveToRegistry();
  414. // path is up-to-date now
  415. m_BuildPathChanged = false;
  416. // put the cursor back
  417. ::SetCursor(LoadCursor(NULL, IDC_ARROW));
  418. }
  419. // callback for combo box menu where build selection
  420. void CMakeSetupDialog::OnSelendokWhereBuild()
  421. {
  422. m_WhereBuildControl.GetLBText(m_WhereBuildControl.GetCurSel(),
  423. m_WhereBuild);
  424. this->UpdateData(FALSE);
  425. this->OnChangeWhereBuild();
  426. }
  427. // callback for combo box menu where source selection
  428. void CMakeSetupDialog::OnSelendokWhereSource()
  429. {
  430. m_WhereSourceControl.GetLBText(m_WhereSourceControl.GetCurSel(),
  431. m_WhereSource);
  432. this->UpdateData(FALSE);
  433. this->OnChangeWhereSource();
  434. }
  435. // callback for chaing source directory
  436. void CMakeSetupDialog::OnChangeWhereSource()
  437. {
  438. }
  439. // callback for changing the build directory
  440. void CMakeSetupDialog::OnChangeWhereBuild()
  441. {
  442. this->UpdateData();
  443. std::string cachefile = m_WhereBuild;
  444. cachefile += "/CMakeCache.txt";
  445. m_CacheEntriesList.RemoveAll();
  446. if(cmSystemTools::FileExists(cachefile.c_str()))
  447. {
  448. m_CacheEntriesList.ShowWindow(SW_SHOW);
  449. this->LoadCacheFromDiskToGUI();
  450. m_BuildPathChanged = true;
  451. }
  452. }
  453. // copy from the cache manager to the cache edit list box
  454. void CMakeSetupDialog::FillCacheGUIFromCacheManager()
  455. {
  456. const cmCacheManager::CacheEntryMap &cache =
  457. cmCacheManager::GetInstance()->GetCacheMap();
  458. for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin();
  459. i != cache.end(); ++i)
  460. {
  461. const char* key = i->first.c_str();
  462. const cmCacheManager::CacheEntry& value = i->second;
  463. switch(value.m_Type )
  464. {
  465. case cmCacheManager::BOOL:
  466. if(cmCacheManager::GetInstance()->IsOn(key))
  467. {
  468. m_CacheEntriesList.AddProperty(key,
  469. "ON",
  470. value.m_HelpString.c_str(),
  471. CPropertyList::CHECKBOX,"");
  472. }
  473. else
  474. {
  475. m_CacheEntriesList.AddProperty(key,
  476. "OFF",
  477. value.m_HelpString.c_str(),
  478. CPropertyList::CHECKBOX,"");
  479. }
  480. break;
  481. case cmCacheManager::PATH:
  482. m_CacheEntriesList.AddProperty(key,
  483. value.m_Value.c_str(),
  484. value.m_HelpString.c_str(),
  485. CPropertyList::PATH,"");
  486. break;
  487. case cmCacheManager::FILEPATH:
  488. m_CacheEntriesList.AddProperty(key,
  489. value.m_Value.c_str(),
  490. value.m_HelpString.c_str(),
  491. CPropertyList::FILE,"");
  492. break;
  493. case cmCacheManager::STRING:
  494. m_CacheEntriesList.AddProperty(key,
  495. value.m_Value.c_str(),
  496. value.m_HelpString.c_str(),
  497. CPropertyList::EDIT,"");
  498. break;
  499. case cmCacheManager::INTERNAL:
  500. break;
  501. }
  502. }
  503. }
  504. // copy from the list box to the cache manager
  505. void CMakeSetupDialog::FillCacheManagerFromCacheGUI()
  506. {
  507. cmCacheManager::GetInstance()->GetCacheMap();
  508. std::set<CPropertyItem*> items = m_CacheEntriesList.GetItems();
  509. for(std::set<CPropertyItem*>::iterator i = items.begin();
  510. i != items.end(); ++i)
  511. {
  512. CPropertyItem* item = *i;
  513. cmCacheManager::CacheEntry *entry =
  514. cmCacheManager::GetInstance()->GetCacheEntry(
  515. (const char*)item->m_propName);
  516. if (entry)
  517. {
  518. entry->m_Value = item->m_curValue;
  519. }
  520. }
  521. }
  522. //! Load cache file from m_WhereBuild and display in GUI editor
  523. void CMakeSetupDialog::LoadCacheFromDiskToGUI()
  524. {
  525. if(m_WhereBuild != "")
  526. {
  527. cmCacheManager::GetInstance()->LoadCache(m_WhereBuild);
  528. this->FillCacheGUIFromCacheManager();
  529. }
  530. }
  531. //! Save GUI values to cmCacheManager and then save to disk.
  532. void CMakeSetupDialog::SaveCacheFromGUI()
  533. {
  534. this->FillCacheManagerFromCacheGUI();
  535. if(m_WhereBuild != "")
  536. {
  537. cmCacheManager::GetInstance()->SaveCache(m_WhereBuild);
  538. }
  539. }