Commit Graph

41 Commits

Author SHA1 Message Date
Clinton Stimpson 5b30ec28f9 file: Add ENCODING option to file(STRINGS) command (#10519)
Support extraction of UTF-8 strings.
2014-08-06 09:23:47 -04:00
Ben Boeckel 411f77d14f EVIS: Add tests for syntax corner cases and CMP0053
Include tests for:

- @ expansion during normal execution
- various characters in variable names for comparison between the new
  and the old parser
- corner cases in the parsers
- correct messages when behavior is different
2014-05-08 13:24:49 -04:00
Stephen Kelly 28e1d2f8fc cmStringCommand: Add GENEX_STRIP subcommand.
Strip out any generator expressions in the input string.
2014-03-31 23:18:44 +02:00
Stephen Kelly 0ab50aea4c string: Add MAKE_C_IDENTIFIER subcommand 2013-05-21 15:29:34 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04: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
Rolf Eike Beer 36cb701690 allow STRING(SUBSTRING) work with length -1 as "rest of the string"
This fixes the first half of bug 10740.
2010-12-08 16:38:30 -05:00
Alexander Neundorf f5bcc82b13 Add a test for FILE(READ ... HEX) together with a tiny binary file.
Alex
2009-09-06 10:26:24 -04:00
Brad King 33a1076b84 BUG: file(COPY) test should not make read-only dir
CMake directory removal code cannot remove content from read-only
directories (a separate bug which will be fixed).  Therefore we should
not create them in the StringFileTest.  This tweaks the file(COPY) call
to test not giving OWNER_WRITE to files rather than directories.
2009-05-13 10:30:22 -04:00
Brad King c58ca24286 ENH: Create file(COPY) command signature
The file(INSTALL) command has long been undocumented and used only to
implement install() scripts.  We now document it and provide a similar
file(COPY) signature which is useful in general-purpose scripts.  It
provides the capabilities of install(DIRECTORY) and install(FILES) but
operates immediately instead of contributing to install scripts.
2009-04-29 13:13:29 -04:00
Brad King 0d92350bb6 ENH: Create file(RENAME) command mode
This creates command "file(RENAME <oldname> <newname>)" to rename a file
or directory within a single disk volume.
2009-04-15 09:58:13 -04:00
Brad King ecb0f3af55 ENH: New foreach(<var> IN ...) mode
This creates a new mode of the foreach command which allows precise
iteration even over empty elements.  This mode may be safely extended
with more keyword arguments in the future.  The cost now is possibly
breaking scripts that iterate over a list of items beginning with 'IN',
but there is no other way to extend the syntax in a readable way.
2009-03-17 15:10:15 -04:00
Brad King 625ef26163 ENH: Allow most characters in ENV variable refs
The $ENV{VAR} syntax permits access to environment variables.  This
teaches CMake to recognize most characters in the VAR name since some
environments may have variables with non-C-identifier characters.
2008-12-17 08:24:35 -05:00
Ken Martin ce8810c4e7 ENH: preclean some warnings 2008-03-25 11:27:18 -04:00
Brad King 3fbd0ad869 ENH: Add test for FILE(READ ...HEX). 2008-01-02 18:00:19 -05:00
Alexander Neundorf ef13337c1f ENH: added tests for the CMAKE_MATCH_(0..9) variables, which get set by
regex matches (STRING(REGEX), IF(MATCHES))

Alex
2007-08-29 12:01:58 -04:00
Brad King db0f26e852 BUG: Fixed @ONLY configuration to not try to parse ${} syntax at all. This fixes the original fix to bug#4393 and adds a test. 2007-06-06 16:20:02 -04:00
Alexander Neundorf f4eb541880 ENH: make the compiler id detection work, even if the output file name of
the compiler is completely unknown and even if it produces intel hex or
motorola s-record files, with test

Alex
2007-05-25 15:22:22 -04:00
Andy Cedilnik 1d4613a63b ENH: Add STRING STRIP command 2007-04-26 21:50:52 -04:00
Brad King 0fb689973e ENH: Added FILE(STRINGS) command. 2007-04-25 17:22:07 -04:00
Brad King b25629efc4 ENH: Remove old IF(FILE_IS_NEWER) syntax. It was never in a release anyway. 2006-10-23 17:14:20 -04:00
Brad King d1a9c93119 ENH: Patch from Alex to provide nicer syntax for FILE_IS_NEWER. Using name IS_NEWER_THAN so old syntax will continue to work. 2006-10-23 13:37:24 -04:00
Brad King 97c97730a6 BUG: Character + should be valid in a variable name. 2006-09-25 10:05:07 -04:00
Brad King 6449089436 ENH: Patch from Alex for adding IF(FILE_IS_NEWER). I also added a test. 2006-08-25 16:31:07 -04:00
Andy Cedilnik d41f97a5e6 ENH: Add relative tag and add test for relative tag 2006-03-21 16:03:19 -05:00
Andy Cedilnik 12ef4edf64 ENH: Add String length and substring 2005-10-17 09:56:42 -04:00
Andy Cedilnik 6e5cdd6de7 ENH: Add regular string replace (not regex), and relative path command. Also add tests 2005-10-17 09:10:20 -04:00
Brad King bc26a216b4 BUG#1179: Fix for syntax in unquoted arguments. 2004-09-20 08:51:12 -04:00
Andy Cedilnik 8750f1c277 ENH: Add RANGE support to FOREACH 2004-04-29 15:12:40 -04:00
Brad King 4990e1481d ENH: Added STRING(CONFIGURE ...) command. 2004-03-04 10:05:14 -05:00
Brad King 08441daded ENH: Added CommandLineTest to add coverage for command line arguments to cmake executables. This replaces the old DumpDocumentation test. 2003-07-24 10:58:40 -04:00
Andy Cedilnik 1a0ca72648 ENH: More coverage 2003-07-23 18:01:41 -04:00
Brad King d4289ee2a9 ENH: Added more verbose output of what globbing results. 2003-07-23 09:10:39 -04:00
Andy Cedilnik 6920d40ac6 ENH: More coverage 2003-07-22 11:17:47 -04:00
Andy Cedilnik e63dd4e329 ENH: Increase coverage 2003-07-22 10:45:42 -04:00
Andy Cedilnik 2d513c2364 ENH: fix glob on windows and add glob recurse test 2003-07-21 15:29:29 -04:00
Andy Cedilnik 187a58430b ENH: add more coverage tests 2003-07-21 13:48:18 -04:00
Andy Cedilnik add486e818 ENH: Add additional new line after the string to match the change in file command 2003-07-17 14:56:44 -04:00
Andy Cedilnik 27ecfcea6d ENH: Add missing include 2003-07-10 14:48:53 -04:00
Andy Cedilnik b75c229444 ENH: Add test for string and file commands 2003-07-10 14:29:30 -04:00