CMakeCommandLineInfo.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // CMakeCommandLineInfo.cpp : command line arguments
  2. //
  3. #include "stdafx.h"
  4. #include "CMakeCommandLineInfo.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. ///////////////////////////////////////////////////////////////
  11. // CMakeCommandLineInfo
  12. CMakeCommandLineInfo::CMakeCommandLineInfo()
  13. {
  14. m_WhereSource = _T("");
  15. m_WhereBuild = _T("");
  16. }
  17. CMakeCommandLineInfo::~CMakeCommandLineInfo()
  18. {
  19. }
  20. ///////////////////////////////////////////////////////////////
  21. // Parse param
  22. void CMakeCommandLineInfo::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
  23. {
  24. if(bFlag)
  25. {
  26. CString sParam(lpszParam);
  27. // Single letter valued flag like /B=value or /B:value
  28. if (sParam[1] == '=' || sParam[1] == ':')
  29. {
  30. CString value(sParam.Right(sParam.GetLength() - 2));
  31. switch (sParam[0])
  32. {
  33. case 'H':
  34. m_WhereSource = value;
  35. break;
  36. case 'B':
  37. m_WhereBuild = value;
  38. break;
  39. }
  40. }
  41. }
  42. // Call the base class to ensure proper command line processing
  43. CCommandLineInfo::ParseParam(lpszParam, bFlag, bLast);
  44. }