diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2001-08-21 21:41:12 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2001-08-21 21:41:12 (GMT) |
commit | 9b259810684b1dc791b71ca45014340e48c8e343 (patch) | |
tree | dc4602455a1d64b8ef53d154151bebe7a96a499a /Source/MFCDialog/CMakeCommandLineInfo.cpp | |
parent | a159c2d306368bddae574a83464cff5e00230369 (diff) | |
download | CMake-9b259810684b1dc791b71ca45014340e48c8e343.zip CMake-9b259810684b1dc791b71ca45014340e48c8e343.tar.gz CMake-9b259810684b1dc791b71ca45014340e48c8e343.tar.bz2 |
CMakeSetup now handles command-line arguments (ex: /H=source_dir /B=build_dir)
Diffstat (limited to 'Source/MFCDialog/CMakeCommandLineInfo.cpp')
-rw-r--r-- | Source/MFCDialog/CMakeCommandLineInfo.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeCommandLineInfo.cpp b/Source/MFCDialog/CMakeCommandLineInfo.cpp new file mode 100644 index 0000000..aefb349 --- /dev/null +++ b/Source/MFCDialog/CMakeCommandLineInfo.cpp @@ -0,0 +1,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); +} |