diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2001-12-03 20:59:17 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2001-12-03 20:59:17 (GMT) |
commit | 906f0a33398a16e95b047f07e8dd1c8e7f3b0375 (patch) | |
tree | f5b37072fdbcf78e52fdf425fb62d5301520628c /Source/MFCDialog/CMakeCommandLineInfo.cpp | |
parent | 9214ad0ec663daaecdf7272175451433c9457254 (diff) | |
download | CMake-906f0a33398a16e95b047f07e8dd1c8e7f3b0375.zip CMake-906f0a33398a16e95b047f07e8dd1c8e7f3b0375.tar.gz CMake-906f0a33398a16e95b047f07e8dd1c8e7f3b0375.tar.bz2 |
Add /A and /G command-line param to carry the value of "Show Advanced" and generator name in desktop shortcuts
Diffstat (limited to 'Source/MFCDialog/CMakeCommandLineInfo.cpp')
-rw-r--r-- | Source/MFCDialog/CMakeCommandLineInfo.cpp | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/Source/MFCDialog/CMakeCommandLineInfo.cpp b/Source/MFCDialog/CMakeCommandLineInfo.cpp index aefb349..26c705b 100644 --- a/Source/MFCDialog/CMakeCommandLineInfo.cpp +++ b/Source/MFCDialog/CMakeCommandLineInfo.cpp @@ -17,12 +17,34 @@ CMakeCommandLineInfo::CMakeCommandLineInfo() { m_WhereSource = _T(""); m_WhereBuild = _T(""); + m_AdvancedValues = FALSE; + m_GeneratorChoiceString = _T(""); } CMakeCommandLineInfo::~CMakeCommandLineInfo() { } +int CMakeCommandLineInfo::GetBoolValue(const CString& v) { + CString value = v; + value.MakeLower(); + if (value == "1" || + value == "on" || + value == "true" || + value == "yes") + { + return 1; + } + else if (value == "0" || + value == "off" || + value == "false" || + value == "no") + { + return -1; + } + return 0; +} + /////////////////////////////////////////////////////////////// // Parse param @@ -35,14 +57,29 @@ void CMakeCommandLineInfo::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast) if (sParam[1] == '=' || sParam[1] == ':') { CString value(sParam.Right(sParam.GetLength() - 2)); + int res; switch (sParam[0]) { - case 'H': - m_WhereSource = value; + case 'A': + res = CMakeCommandLineInfo::GetBoolValue(value); + if (res == 1) + { + m_AdvancedValues = TRUE; + } + else if (res == -1) + { + m_AdvancedValues = FALSE; + } break; case 'B': m_WhereBuild = value; break; + case 'G': + m_GeneratorChoiceString = value; + break; + case 'H': + m_WhereSource = value; + break; } } } |