summaryrefslogtreecommitdiffstats
path: root/Source/cmParseArgumentsCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-2/+2
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-4/+4
|
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Merge topic 'cmCommand_refactor'Brad King2019-08-221-20/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6ab28b9413 cmCommand refactor: cmStringCommand 36f32d3604 cmCommand refactor: cmSetPropertyCommand 7c83c19205 cmCommand refactor: cmSetDirectoryPropertiesCommand 9413952c42 cmCommand refactor: cmCMakePolicyCommand 07ea93de54 cmCommand refactor: cmWriteFileCommand ca3b9186bb cmCommand refactor: cmVariableWatchCommand b1acc711f4 cmCommand refactor: cmRemoveCommand 413a960391 cmCommand refactor: cmCMakeHostSystemInformationCommand ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3673
| * cmCommand refactor: cmParseArgumentsCommandGabor Bencze2019-08-201-20/+21
| |
* | clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-2/+2
|/
* Merge topic 'cmExpandList'Kyle Edwards2019-08-161-4/+4
|\ | | | | | | | | | | | | | | | | 2f6495e24e cmSystemTools: Remove ExpandListArgument methods f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument ff42dec891 cmStringAlgorithms: Add cmExpandList functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3682
| * Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-4/+4
| |
* | cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-101-2/+2
|/ | | | | | | | This adds the following functions to cmStringAlgorithms: - `cmStrToLong`: moved from `cmSystemTools::StringToLong` - `cmStrToULong`: moved from `cmSystemTools::StringToULong` Overloads of the given functions for `std::string` are added as well.
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-6/+5
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* cmParseArgumentsCommand: Port to cmArgumentParserRegina Pfeifer2019-04-041-114/+45
|
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
|
* cmake_parse_arguments: add KEYWORDS_MISSING_VALUESTorsten Robitzki2019-02-071-7/+47
| | | | | | | Add KEYWORDS_MISSING_VALUES output variable to cmake_parse_arguments() to allow to detect keywords that received no values. Fixes: #18706
* cmake_parse_arguments: Factor out part of implementation for re-useTorsten Robitzki2019-02-061-39/+53
|
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-1/+1
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-8/+11
| | | | Reduce the number of files relying on `cmake.h`.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-2/+2
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Solaris: Fix shadowed declaration warningCraig Scott2017-12-201-13/+13
| | | | | | | "single" is a type declared in /usr/include/floatingpoint.h on Solaris, so the local variable of the same name in cmParseArgumentsCommand.cxx was triggering a compiler warning about the local variable shadowing the type.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-49/+37
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-1/+0
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+11
|
* Separate compilation for commands included in cmBootstrapCommands1Daniel Pfeifer2016-10-211-0/+1
|
* cmake_parse_arguments: Fix PARSE_ARGV multi-value argument handlingMatthew Woehlke2016-09-281-2/+23
| | | | | | | | | The `PARSE_ARGV` mode was recently added to help functions properly parse their arguments even when those arguments may be quoted and contain literal `;` in their values. Fix the implementation to encode `;`s in reported multi-value arguments and in `UNPARSED_ARGUMENTS` so that `;`s in the individual values are preserved in the lists. This allows clients to access all their argument values correctly.
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* cmake_parse_arguments: Add option to read arguments from ARGC/ARGV#Bill Hoffman2016-09-081-4/+53
| | | | | | | | | The `ARGC`/`ARGV#` variables in function scope hold the original arguments with no ;-list flattening. Add a way for functions to cleanly parse arguments that may contain `;`. This also avoids extra copying of the arguments. Co-Author: Brad King <brad.king@kitware.com>
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-77/+51
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* cmake_parse_arguments: Restore ;-list argument flatteningDimitar Yordanov2016-02-121-2/+10
| | | | | | | | | | | | | | | | The re-implementation in commit v3.5.0-rc1~116^2~1 (CMakeParseArguments: replace by native cmake_parse_arguments command, 2015-12-05) introduced a regression when parsing the ARGN arguments with cmake_parse_arguments. The original implementation used foreach(currentArg ${ARGN}) to iterate over input arguments. This flattened ;-lists within the arguments whether they were quoted or not. Fix our new implementation to preserve this behavior and add a test case to cover it. Signed-off-by: Dimitar Yordanov <dimitar.yordanov@sap.com> Signed-off-by: Matthias Maennich <matthias.maennich@sap.com>
* cmake_parse_arguments: consider duplicate keyword as warningMatthias Maennich2015-12-171-0/+16
| | | | | | The behaviour of double specified keywords is rather undefined or at least not clearly documented. This change introduces a strict check and emits a warning in case a keyword has been specified more than once.
* CMakeParseArguments: replace by native cmake_parse_arguments commandMatthias Maennich2015-12-171-0/+176
Implement a native `cmake_parse_arguments` command that is fully compatible with the documented behaviour of the previous implementation. Leave the CMakeParseArguments module empty but existing for compatibility.