summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* file: Teach STRINGS to support UTF-16 and UTF-32 encodingsJustin Borodinsky2015-01-271-3/+61
|
* cmake: Use a default CA path when not using system curlBrad King2015-01-231-4/+5
| | | | | | | | | | | | | | | | | | | | When using system curl, we trust it to be configured with desired CA certs. When using our own build of curl, we use os-configured CA certs on Windows and OS X. On other systems, try to achieve this by searching for common CA cert locations. According to a brief investigation, the curl packages on popular Linux distros are currently configured as: * Arch: /etc/ssl/certs/ca-certificates.crt * Debian with OpenSSL: /etc/ssl/certs * Debian with GNU TLS: /etc/ssl/certs/ca-certificates.crt * Debian with NSS: /etc/ssl/certs/ca-certificates.crt * Fedora: /etc/pki/tls/certs/ca-bundle.crt * Gentoo with OpenSSL: /etc/ssl/certs * Gentoo without OpenSSL: /etc/ssl/certs/ca-certificates.crt Teach CMake and CTest to look for these paths and use them as a CA path or bundle when no other os-configured or user-specified CAs are available.
* Replace 'foo.length() >= 1' pattern with !foo.empty()Stephen Kelly2015-01-181-1/+1
|
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-10/+10
|
* 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-3/+3
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-49/+49
| | | | All compilers hosting CMake support the std class.
* file: Use 'long' to represent the parsed LOCK TIMEOUT valueRuslan Baratov2014-12-051-4/+5
| | | | | | | | | Convert the StringToInt helper into a StringToLong helper with a 'long' result type. This will make the helper more useful to other callers that want to use strtol. While at it, also check errno after calling strtol in case the conversion fails with a range error.
* file: Add LOCK subcommand to do file and directory lockingRuslan Baratov2014-12-031-0/+203
| | | | | | | | | Provide options to fail without blocking or to block up to a timeout. Provide options to specify the scope containing the lock so it can be released automatically at the end of a function, file, or process. Extend the RunCMake.file test with cases covering the file(LOCK) command usage and error cases.
* Remove some unneeded c_str calls.Stephen Kelly2014-11-231-2/+2
|
* Encoding: Use encoding libcurl expects with file: urls.Clinton Stimpson2014-11-051-0/+38
| | | | | | | | For unescaped file: URLs on Windows, libcurl expects the ANSI code page. This fixes the CMake.FileUpload test when CMake is configured to use UTF-8 internally with a non-ascii build directory name.
* Merge topic 'remove-borland-build'Brad King2014-10-211-2/+0
|\ | | | | | | | | 2db55ffa Remove borland workarounds.
| * Remove borland workarounds.Stephen Kelly2014-10-151-2/+0
| | | | | | | | | | CMake 3.0 is the last release to require to be able to build with Borland.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-8/+8
|/ | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* file: Add ENCODING option to file(STRINGS) command (#10519)Clinton Stimpson2014-08-061-1/+69
| | | | Support extraction of UTF-8 strings.
* file: Refactor internal implementation of file(STRINGS)Clinton Stimpson2014-08-061-18/+28
| | | | Make room for encoding support.
* Encoding: Replace some system calls with kwsys calls which handle unicode.Clinton Stimpson2014-07-011-10/+2
|
* file(INSTALL): Add undocumented options to control output verbosityBrad King2014-06-241-3/+58
| | | | | | Create options "MESSAGE_ALWAYS", "MESSAGE_LAZY", and "MESSAGE_NEVER" to specify whether to print the "Installing" and "Up-to-date" messages. Extend the RunCMake.file test with cases covering these options.
* file(INSTALL): Report existing DIRECTORY as Up-to-dateBrad King2014-06-241-1/+2
| | | | | | | | | | | Teach cmFileCopier::InstallDirectory to detect whether the destination directory exists. If so, report it as "Up-to-date" instead of "Installing". This resolves message asymmetry with file installations. Extend the RunCMake.file and RunCMake.install tests to check the installation output on both the first and second run. Suggested-by: J Decker <d3ck0r@gmail.com>
* file(INSTALL): Do not pre-create DESTINATION for DIRECTORYBrad King2014-06-241-10/+13
| | | | | | When installing a DIRECTORY, do not pre-create the DESTINATION. The cmFileCopier::InstallDirectory method will create the directory anyway. Give it a chance to detect whether the directory already exists or not.
* genex: remove the need for backtracesBen Boeckel2014-06-051-2/+2
| | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* cmMakefile: return a backtraceBen Boeckel2014-06-051-2/+1
| | | | | This allows backtraces to be fully controlled by the makefile rather than externally (and makes changing how they are manipulated easier).
* file: Report system error on failure to open fileBrad King2014-05-201-6/+8
|
* file: Avoid runaway DOWNLOAD/UPLOAD progress reports (#14807)Brad King2014-03-171-0/+5
| | | | | | | | Curl makes progress callbacks frequently but we round to the nearest percent and report only when that changes so that we make at most 101 progress reports. However, when unexpected data beyond the total are transferred the progress can get beyond 100% and lead to unlimited reports. Avoid this case by capping the reported progress to 100%.
* Remove some c_str() calls.Stephen Kelly2014-03-111-71/+71
| | | | | | 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.
* file DOWNLOAD: Display the curl result status when a hash mismatch occurs.Matt McCormick2014-01-161-0/+2
|
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-8/+9
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Remove some uses of obsolete 'register' storage specifierSean McBride2013-06-281-2/+2
| | | | Remove the keyword from all Source/* files outside of KWSys.
* Merge topic 'genex-generate-file'Brad King2013-05-281-0/+78
|\ | | | | | | | | b983a58 file: Add GENERATE command to produce files at generate time
| * file: Add GENERATE command to produce files at generate timeStephen Kelly2013-05-241-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to write to a temp file which contains generator expressions, and at generate time, evaluate the generator expressions, and write the result to a file. Because executables on Windows are limited in the length of command line it is possible to use, it is common to write command line arguments to a file instead and specify the file as a source of arguments. This new FILE(GENERATE) subcommand allows the use of generator expressions to create such files so that they can be used with add_custom_command for example.
* | Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-2/+2
|/
* file: Do not remove symlinked directories recursively (#10538)Brad King2013-02-131-1/+2
| | | | | If a symlink points at a directory the symlink should be removed but not the content of the directory.
* CMake: Fix dashboard warningsDavid Cole2012-12-051-1/+1
| | | | ...in the new file and string TIMESTAMP sub-commands
* CMake: Add TIMESTAMP subcommand to string and file commandsNils Gladitz2012-12-051-0/+57
|
* file: remove dead codeAmine Chadly2012-11-021-10/+5
| | | | | | The file command requires at least two arguments, so guarding the GLOB and MAKE_DIRECTORY command is not necessary. Changed it for an assert to keep the protection.
* Merge topic 'file-DOWNLOAD-EXPECTED_HASH'David Cole2012-09-251-17/+18
|\ | | | | | | | | 95a0011 file(DOWNLOAD): Change EXPECTED_HASH to take ALGO=value
| * file(DOWNLOAD): Change EXPECTED_HASH to take ALGO=valueBrad King2012-09-191-17/+18
| | | | | | | | | | | | Make the EXPECTED_HASH option take only a single value instead of two to avoid handling sub-keyword arguments. This is also consistent with URL_HASH in ExternalProject.
* | Merge topic 'file-DOWNLOAD-user-agent'Brad King2012-09-191-0/+3
|\ \ | |/ |/| | | | | 14aff4d file(DOWNLOAD): Add HTTP User-Agent string
| * file(DOWNLOAD): Add HTTP User-Agent stringBrad King2012-09-181-0/+3
| | | | | | | | | | | | | | Some servers require a User-Agent string. The curl command-line tool just sends "curl/$curlver", so do the same. Suggested-by: Fredrik Ehnbom <fehnbom@nvidia.com>
* | file(DOWNLOAD): Make TLS options behave as documentedBrad King2012-09-171-33/+13
| | | | | | | | | | | | | | | | | | The logic added in commit e1c89f08 (file(DOWNLOAD): Add options for SSL, 2012-08-21) did not actually provide the documented behavior. Simplify the implementation to read the variable values first and then replace them with the explicit argument values if encountered. Always set the curl option CURLOPT_SSL_VERIFYPEER to either on or off explicitly instead of depending on the curl default behavior.
* | Rename SSL terminology to TLSBrad King2012-09-141-17/+17
|/ | | | | | TLS has superseded SSL so rename the recently added file(DOWNLOAD) and ExternalProject options using the newer terminology. Drop "CURLOPT" from names because curl is an implementation detail.
* file(DOWNLOAD): Add options for SSLBill Hoffman2012-09-111-0/+67
| | | | | | | Add the ability to request that downloads disable or enable Certificate Authority checking with https ssl downloads. When the option to verify the servers CA is disabled, one may verify download contents with SHA hashes.
* file(DOWNLOAD): Generalize EXPECTED_MD5 to EXPECTED_HASHBill Hoffman2012-09-111-36/+53
| | | | Add support for SHA algorithms.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-5/+5
| | | | | | | | | | | | | | | | | 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/ \+$//'
* Merge topic 'install-case-sensitive-mac'David Cole2012-06-141-2/+4
|\ | | | | | | | | a41557a install: Fix FILES_MATCHING on case-sensitive Mac filesystems (#13177)
| * install: Fix FILES_MATCHING on case-sensitive Mac filesystems (#13177)Brad King2012-06-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows and Apple machines have predominantly used case-insensitive filesystems so our file(INSTALL) command uses case-insensitive pattern matching. It is implemented by converting the pattern and file path to lower case before matching. The FILES_MATCHING option is implemented by excluding a path that does not match any pattern unless it is a directory that must be searched recursively. However, the test that an excluded path is a directory is executed on the lower-case path and therefore fails on mixed-case input paths on case-sensitive filesystems. Fix the file(INSTALL) implementation to use the lower-case path only for pattern matching and preserve the original path for tests against the real filesystem.
* | Workaround IBM XL v6 streams seekg bug (#13149)Jim Hague2012-04-191-1/+1
|/ | | | | | It seems that file.seekg(0) will, in some circumstances, cause the next file.getline() to omit the first character it reads. Workaround the bug by seeking from ios::beg explicitly.
* Factor cmInstallType out of cmTarget::TargetTypeBrad King2012-02-271-16/+17
| | | | | | The purpose of the TargetType enumeration was overloaded for install type because install rules were once recorded as targets. Factor the install types out into their own enumeration.
* Disable file() and string() hash commands during bootstrapBrad King2011-11-161-0/+7
| | | | | We do not compile support for the cryptographic hashes during bootstrap. Disable the APIs that use them.
* cmCryptoHash: Provide factory "New" methodBrad King2011-11-161-13/+1
| | | | | Construct a cmCryptoHash subclass instance based on the name of the desired hash algorithm.