summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/CMakeCommandLineInfo.cpp
blob: aefb349e12c722e565ced782f9946e052b7d3435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// CMakeCommandLineInfo.cpp : command line arguments
//

#include "stdafx.h"
#include "CMakeCommandLineInfo.h" 

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif 

///////////////////////////////////////////////////////////////
// CMakeCommandLineInfo 

CMakeCommandLineInfo::CMakeCommandLineInfo()
{
  m_WhereSource = _T("");
  m_WhereBuild = _T("");
} 

CMakeCommandLineInfo::~CMakeCommandLineInfo()
{
} 

///////////////////////////////////////////////////////////////
// Parse param

void CMakeCommandLineInfo::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
{
  if(bFlag) 
    {
    CString sParam(lpszParam);
    // Single letter valued flag like /B=value or /B:value
    if (sParam[1] == '=' || sParam[1] == ':')
      {
      CString value(sParam.Right(sParam.GetLength() - 2));
      switch (sParam[0])
        {
        case 'H':
          m_WhereSource = value;
          break;
        case 'B':
          m_WhereBuild = value;
          break;
        }
      }
    }

  // Call the base class to ensure proper command line processing
  CCommandLineInfo::ParseParam(lpszParam, bFlag, bLast);
}