diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-05-25 20:46:50 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-05-25 20:46:50 (GMT) |
commit | 55f11b348bdfd94f28c95cea2e72a79fa1a1fc5d (patch) | |
tree | 550118d0573f523740fad14fdd0c55875aec5fa5 /Source/cmFileCommand.h | |
parent | d6f779a9b0abf2a00119c9ab9ab73e360ba1bf7f (diff) | |
download | CMake-55f11b348bdfd94f28c95cea2e72a79fa1a1fc5d.zip CMake-55f11b348bdfd94f28c95cea2e72a79fa1a1fc5d.tar.gz CMake-55f11b348bdfd94f28c95cea2e72a79fa1a1fc5d.tar.bz2 |
ENH: add option to FILE(STRINGS NO_HEX_CONVERSION) to disable automatic
conversion of hex and srec files to binary.
Without this automatic conversion, everywhere where a compiled file is parsed for strings the
a file(HEX2BIN somefile binfile) command has to be added otherwise it will
not work for these compilers. I tried this with DetermineCompiler and
CheckTypeSize and nobody will do this except the users who work with such
compilers. For them it will break if they don't add this conversion command
in all these places.
If FILE(STRINGS) is used with a text file, it
will in most cases still work as expected, since it will only convert hex
and srec files. If a user actually wants to get text out of hex files, he
knows what he's doing and will see the hint in the documentation.
Anyway, it should work without having to create a temporary file, will work
on this later.
Alex
Diffstat (limited to 'Source/cmFileCommand.h')
-rw-r--r-- | Source/cmFileCommand.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 5868725..029e698 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -72,7 +72,9 @@ public: " FILE(STRINGS filename variable [LIMIT_COUNT num]\n" " [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]\n" " [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]\n" - " [NEWLINE_CONSUME] [REGEX regex])\n" + " [NEWLINE_CONSUME] [REGEX regex]\n" + " [NO_HEX_CONVERSION])\n" + " FILE(HEX_TO_BIN inputfile outputfile)\n" " FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n" " FILE(GLOB_RECURSE variable [RELATIVE path] \n" " [globbing expressions]...)\n" @@ -93,10 +95,14 @@ public: "want to generate input files to CMake.\n" "READ will read the content of a file and store it into the " "variable.\n" - "STRINGS will parse a list of ASCII strings from a binary file and " + "STRINGS will parse a list of ASCII strings from a file and " "store it in a variable. Binary data in the file are ignored. Carriage " "return (CR) characters are ignored. It works also for Intel Hex and " - "Motorola S-record files.\n " + "Motorola S-record files, which are automatically converted to binary " + "format when reading them. Disable this using NO_HEX_CONVERSION.\n " +/* "HEX_TO_BIN will convert an Intel hex file or Motorola S-record file " + "to a binary file. If the input file is no such file it will simply " + "be copied. \n"*/ "LIMIT_COUNT sets the maximum number of strings to return. " "LIMIT_INPUT sets the maximum number of bytes to read from " "the input file. " @@ -147,6 +153,7 @@ protected: bool HandleWriteCommand(std::vector<std::string> const& args, bool append); bool HandleReadCommand(std::vector<std::string> const& args); bool HandleStringsCommand(std::vector<std::string> const& args); +// bool HandleHex2BinCommand(std::vector<std::string> const& args); bool HandleGlobCommand(std::vector<std::string> const& args, bool recurse); bool HandleMakeDirectoryCommand(std::vector<std::string> const& args); |