summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* list: Add TRANSFORM sub-commandMarc Chevrier2018-04-161-0/+556
| | | | Issue: #17823
* list: Add SUBLIST sub-commandMarc Chevrier2018-03-211-0/+52
| | | | Issue: #17823
* list(): add `JOIN` sub-commandMarc Chevrier2018-03-201-0/+31
|
* Replace C-style castsDaniel Pfeifer2017-08-271-6/+6
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-6/+13
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+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.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-230/+162
| | | | | | | | | | | | | 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-15/+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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* 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.
* list: Add FILTER subcommand (#3986)Ashley Whetter2016-02-031-0/+109
| | | | Create a `list(FILTER)` command to filter lists by regular expression.
* cmAlgorithms: Rename cmRange to cmMakeRange.Stephen Kelly2015-07-221-6/+6
|
* Port to static cmPolicies API.Stephen Kelly2015-05-041-4/+2
|
* Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|
* cmAlgorithms: Add cmReverseRange adaptor.Stephen Kelly2015-02-201-2/+1
| | | | Use it to implement list(REVERSE).
* cmListCommand: Move size variable out of loop.Stephen Kelly2015-02-171-6/+6
| | | | Re-use it where possible in two instances.
* cmListCommand: Avoid needlessly erasing from vectors.Stephen Kelly2015-02-151-17/+21
| | | | | | The entire vector will be destroyed at once at the end of the scope, and the remove algorithms already give us the end of the range of interesting values, so just use those sentinals.
* cmListCommand: Replace remove duplicates loop with algorithm.Stephen Kelly2015-02-151-18/+3
|
* cmListCommand: Implement REMOVE_ITEM in terms of cmRemoveMatching.Stephen Kelly2015-02-151-16/+6
|
* cmListCommand: Replace joining loop with cmJoin algorithm.Stephen Kelly2015-02-151-8/+2
|
* cmListCommand: Use cmRemoveIndices for REMOVE_AT subcommand.Stephen Kelly2015-02-151-16/+9
| | | | | Avoid repeatedly looping over the indices to process elements (even without breaking out of the loop when the element is found).
* cmListCommand: Convert loop to find algorithm.Stephen Kelly2015-02-151-12/+1
|
* cmListCommand: Implement REVERSE subcommand with std::reverse.Stephen Kelly2015-02-151-9/+2
|
* cmListCommand: Use std::find algorithm for FIND subcommand.Stephen Kelly2015-02-151-11/+7
| | | | | | Use a ostringstream to account for the input being a variable of type size_t as a result of using std::distance. There is no single format string which portably accepts a size_t.
* Convert loops to cmJoin algorithm with cmRange.Stephen Kelly2015-02-111-8/+1
|
* Convert loops populating maybe-empty content into the common pattern.Stephen Kelly2015-02-111-4/+8
|
* Merge topic 'consistent-empty-method'Brad King2015-01-191-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 5f69314e Replace foo.length() pattern with !foo.empty(). fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty() f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty(). 86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty(). fd7b3712 Replace foo.size() pattern with !foo.empty(). aa773035 Replace !foo.size() pattern with foo.empty(). 64592633 cmListCommand: Use empty() and expand whitespace. 607e1938 Replace 'foo.size() != 0' pattern with !foo.empty(). 930bd478 Replace 'foo.size() == 0' pattern with foo.empty(). d92887ef Replace 'foo.size() > 0' pattern with !foo.empty().
| * Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
| |
| * cmListCommand: Use empty() and expand whitespace.Stephen Kelly2015-01-181-1/+1
| |
| * Replace 'foo.size() != 0' pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
| |
| * Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-2/+2
| |
* | cmListCommand: Replace loop with member algorithm.Stephen Kelly2015-01-181-7/+3
|/
* Merge topic 'join-algorithm'Brad King2015-01-121-27/+3
|\ | | | | | | | | | | | | 55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable.
| * Use the cmJoin algorithm where possible.Stephen Kelly2015-01-081-27/+3
| |
* | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-4/+4
|/ | | | All compilers hosting CMake support the std class.
* Remove some c_str() calls.Stephen Kelly2014-03-111-28/+28
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-6/+4
| | | | Variable names are always generated by CMake and should never be NULL.
* Consolidate list() argument count testingPetr Kmoch2012-11-021-26/+10
| | | | Move test for list() argument count >= 2 to InitialPass().
* list command: error on too many argumentsRolf Eike Beer2012-08-151-0/+18
| | | | | SORT, REVERSE, and REMOVE_DUPLICATES can only operate on exactly one argument. Until now all other arguments were silently ignored. Give an error instead.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-4/+4
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* list: Handle errors on empty lists more gracefully (#13138)Brad King2012-04-171-1/+14
| | | | | | | | | | | | Since commit ed1ea24c (Fix INSERT to allow inserting to empty list, 2006-05-15) the list command allows insertion into an empty list at index 0. Fix rejection of insertion at non-zero (negative) indices to present an error message instead of crashing. While at it, fix the error message of the GET and REMOVE_AT operations when the list is empty to not present a bogus allowed range. Add a "RunCMake.list" test to cover failure cases on empty lists.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* BUG: fix failing testBill Hoffman2008-05-201-3/+4
|
* BUG: fix bugs in new style list command that handles empty stuffBill Hoffman2008-05-201-57/+24
|
* ENH: fix sort to work with CMP0007Bill Hoffman2008-05-071-0/+6
|
* ENH: handle empty lists correctlyBill Hoffman2008-04-231-0/+5
|
* ENH: fix list command with empty elementsBill Hoffman2008-04-211-2/+56
|