Commit Graph

34 Commits

Author SHA1 Message Date
Brad King dd6c596c12 Merge topic 'join-algorithm'
55a73e6b Use the cmJoin algorithm where possible.
8dc8d756 cmStandardIncludes: Add a join algorithm for string containers.
b5813cee cmInstallCommand: Remove unused variable.
2015-01-12 09:41:02 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Stephen Kelly 55a73e6b1f Use the cmJoin algorithm where possible. 2015-01-08 22:28:18 +01:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
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.
2014-03-11 15:03:50 +01:00
Ben Boeckel 3742bb0d32 stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Petr Kmoch 07251a8ea5 Consolidate list() argument count testing
Move test for list() argument count >= 2 to InitialPass().
2012-11-02 17:09:55 +01:00
Rolf Eike Beer 52d9c38e72 list command: error on too many arguments
SORT, REVERSE, and REMOVE_DUPLICATES can only operate on exactly one argument.
Until now all other arguments were silently ignored. Give an error instead.
2012-08-15 22:12:12 +02:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
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/ \+$//'
2012-08-13 14:18:39 -04:00
Brad King 05604eb9cb list: Handle errors on empty lists more gracefully (#13138)
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.
2012-04-17 11:07:07 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Bill Hoffman afdc33dbb8 BUG: fix failing test 2008-05-20 12:15:40 -04:00
Bill Hoffman fd0e8b3a56 BUG: fix bugs in new style list command that handles empty stuff 2008-05-20 11:30:30 -04:00
Bill Hoffman 2a53075ed8 ENH: fix sort to work with CMP0007 2008-05-07 14:57:29 -04:00
Bill Hoffman 4801fb841f ENH: handle empty lists correctly 2008-04-23 09:56:54 -04:00
Bill Hoffman 0a0672c01f ENH: fix list command with empty elements 2008-04-21 16:57:11 -04:00
Sebastien Barre 3b1bbcfe15 STYLE: yeah yeah. 2008-03-14 16:39:20 -04:00
Sebastien Barre f64d3d0b77 ENH: add REMOVE_DUPLICATES subcommand to LIST command (and test). Remove duplicates from a list (keep the ordering) 2008-03-12 17:02:10 -04:00
Ken Martin 0e69d38004 ENH: add return and break support to cmake, also change basic command invocation signature to be able to return extra informaiton via the cmExecutionStatus class 2008-01-23 10:28:26 -05:00
Brad King a06dcdba97 ENH: Allow LIST(APPEND) command to append nothing. 2008-01-16 11:24:41 -05:00
Alexander Neundorf 2f23ecdb8a ENH: change LIST(CONTAINS ...) TO LIST(FIND ...), which returns the index
and which is more useful, because then you can also access the item behind
the one you were looking, useful for writing macros with optional keywords
with parameters

Alex
2007-08-15 10:26:50 -04:00
Alexander Neundorf c8010cd7fb ENH: add LIST(CONTAINS ...) patch from "Miguel A. Figueroa-Villanueva, miguelf (AT) ieee.org
added tests for LIST(CONTAINS, SORT, REVERSE)

Alex
2007-07-12 11:56:45 -04:00
Brad King 9b89d84210 STYLE: Fixed line-too-long. 2006-08-26 10:29:11 -04:00
Andy Cedilnik c9eaf72567 BUG: Add missing API 2006-08-22 10:16:46 -04:00
Andy Cedilnik 6f7bb4d826 BUG: Fix error messages and fix remove item to actually remove all instances of the item 2006-08-22 09:52:53 -04:00
Andy Cedilnik 70d8c0f3d8 STYLE: Fix style 2006-05-16 08:42:14 -04:00
Andy Cedilnik ed1ea24cef ENH: Fix INSERT to allow inserting to empty list 2006-05-15 10:14:16 -04:00
Andy Cedilnik cb2a9be622 ENH: Change REMOVE and REMOVE_ITEM to REMOVE_AT and REMOVE_ITEM 2006-05-15 09:57:49 -04:00
Andy Cedilnik 3b92585cf0 ENH: Remove some errors, fix append to work on nonexisting lists 2006-05-15 09:25:06 -04:00
Ken Martin 7dc8a92246 STYLE: fix line length 2006-05-12 11:56:09 -04:00
Andy Cedilnik b1b1973736 ENH: Some documentation and add APPEND 2006-05-11 13:56:58 -04:00
Bill Hoffman 5a2668b326 ENH: add support for win64 for visual studio 2005 ide and nmake, also fix warnings produced by building for win64 2006-03-30 13:49:56 -05:00
Bill Hoffman a0471c3fe2 ENH: allow unset vars to be used in list length 2006-03-24 16:13:05 -05:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Andy Cedilnik f87271d0ea ENH: Add initial implementation of the list command 2006-02-10 14:11:12 -05:00