summaryrefslogtreecommitdiff
path: root/Source/cmFileCommand.h
Commit message (Collapse)AuthorAgeFilesLines
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* cmFileCommand: turn into free functionRegina Pfeifer2019-08-061-26/+2
|
* cmFileCommand: put subcommands in unnamed namespaceDaniel Pfeifer2019-08-061-65/+0
|
* cmFileCommand: port to cmExecutionStatusDaniel Pfeifer2019-08-061-28/+54
|
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-1/+6
|
* file: Add GET_RUNTIME_DEPENDENCIES modeKyle Edwards2019-06-101-0/+2
| | | | Co-Authored-by: Bryon Bean <bryon.bean@kitware.com>
* cmFileCommand: Add CREATE_LINK subcommandTushar Maheshwari2019-01-161-0/+1
| | | | | | | | | | | | | | This brings the functionality of `cmake -E create_symlink` and more to scripts. The default behavior is to create hard links. The `SYMBOLIC` argument can be used to create symlinks instead. The `COPY_ON_ERROR` argument enables a fallback to copying the file in case the link fails. The `RESULT <var>` retrieves the error message generated by the system. It is set to "0" on success. Fixes: #16926
* file: Add READ_SYMLINK sub-commandKyle Edwards2018-12-061-0/+1
|
* file: add SIZE optionWouter Klouwen2018-11-271-0/+1
| | | | | This commit adds the SIZE option to file(). It returns the file size of the given path if it exists and produces an error if not.
* Adds file(TOUCH) and file(TOUCH_NOCREATE) sub-commandsShane Parris2018-02-151-0/+1
|
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-2/+2
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* cmCommand: remove unused methods from interface and all implementationsDaniel Pfeifer2017-05-111-5/+0
|
* cmCommand: remove IsScriptableDaniel Pfeifer2017-05-081-5/+0
|
* 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'
* cmConfigure: Ensure separate include block in headersDaniel Pfeifer2017-04-111-0/+1
| | | | | | | | | | | Make sure that `#include <cmConfigure.h>` is followed by an empty line in header files. This is necessary to make sure that changing <> to "" does not affect the include ordering of clang-format. Automate with: git grep -l '#include <cmConfigure.h>' | grep -v '.cxx$' \ | xargs sed -i '/#include <cmConfigure.h>/ { N; N; s/\n\{1,2\}/\n\n/ }'
* file: Add READ_ELF command to parse ELF binariesFlorian Apolloner2017-03-101-0/+1
| | | | | Leave it undocumented for now because we intend to use it internally and it cannot be made available everywhere.
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+5
|
* Make cmCommand not inherit from cmObjectDaniel Pfeifer2016-10-231-2/+0
|
* 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.
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-5/+5
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-11/+6
| | | | | | | | | | | | | 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.
* file: Add LOCK subcommand to do file and directory lockingRuslan Baratov2014-12-031-0/+1
| | | | | | | | | 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.
* stringapi: Command namesBen Boeckel2014-03-081-1/+1
|
* Drop builtin command documentationBrad King2013-10-161-207/+0
| | | | | Drop all GetTerseDocumentation and GetFullDocumentation methods from commands. The command documentation is now in Help/command/*.rst files.
* Docs: Document file(GENERATE) CONDITION as optional.Stephen Kelly2013-07-261-1/+1
|
* file: Add GENERATE command to produce files at generate timeStephen Kelly2013-05-241-0/+19
| | | | | | | | | | | | | | 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.
* CMake: Stylistic changes and documentation tweaksDavid Cole2012-12-051-4/+3
| | | | ...for the contributed file and string TIMESTAMP sub-commands.
* CMake: Add TIMESTAMP subcommand to string and file commandsNils Gladitz2012-12-051-0/+10
|
* Documentation: Clarify some command descriptionsAndreas Mohr2012-11-071-1/+2
| | | | | | | | - file(WRITE): add configure_file() decoupling hint - function(): definitely mention PARENT_SCOPE - include_directories(): mention possible results of SYSTEM setting - macro(): mention scope specifics of function() - message(): improve SEND_ERROR / FATAL_ERROR docs, since people said it's not obvious
* file(DOWNLOAD): Change EXPECTED_HASH to take ALGO=valueBrad King2012-09-191-6/+6
| | | | | | 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.
* Rename SSL terminology to TLSBrad King2012-09-141-6/+6
| | | | | | 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-1/+10
| | | | | | | 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-3/+5
| | | | Add support for SHA algorithms.
* FILE: mention that TO_CMAKE_PATH also handles list delimitersRolf Eike Beer2012-03-301-1/+2
|
* Add 'const' qualifier to some cmCommand membersYury G. Kudryashov2012-02-291-4/+4
| | | | | Use const_cast for the special case in cmFindBase where GetFullDocumentation calls GenerateDocumentation.
* Add file(SHA*) commands to compute cryptographic hashesBrad King2011-11-161-2/+2
| | | | Add a file() command API for SHA1, SHA224, SHA256, SHA384, and SHA512.
* Add file(MD5) command to compute cryptographic hashBrad King2011-11-161-0/+4
| | | | | Provide a CMake-language binding to the md5sum function previously available only by "cmake -E md5sum".
* Teach file(DOWNLOAD|UPLOAD) to timeout after inactivityBrad King2011-06-011-4/+9
| | | | | Add option INACTIVITY_TIMEOUT to terminate the operation if there is no progress for more than a given amount of time.
* Implement file(UPLOAD (#11286)David Cole2011-02-251-0/+15
| | | | Including documentation and testing, of course.
* Warn in find(GLOB) docs about bad use case (#11617)Brad King2010-12-161-1/+6
| | | | | | | | The first instinct of a lot of users is to use file(GLOB) to assemble lists of sources. Add a warning to the help text stating that it should not be used for this purpose and briefly explain why. Suggested-By: Ryan Pavlik
* Improve FILE(DOWNLOAD) and ExternalProject.David Cole2010-05-271-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve FILE(DOWNLOAD ...): - Add percent complete progress output to the FILE DOWNLOAD command. This progress output is off by default to preserve existing behavior. To turn it on, pass SHOW_PROGRESS as an argument. - Add EXPECTED_MD5 argument. Verify that the downloaded file has the expected md5 sum after download is complete. - Add documentation for SHOW_PROGRESS and EXPECTED_MD5. When the destination file exists already and has the expected md5 sum, then do not bother re-downloading the file. ("Short circuit" return.) Also, add a test that checks for the status output indicating that the short circuit behavior is actually occurring. Use a binary file for the test so that the md5 sum is guaranteed to be the same on all platforms regardless of "shifting text file line ending" issues. Improve ExternalProject: - Add argument URL_MD5. - Add verify step that compares md5 sum of .tar.gz file before extracting it. - Add md5 check to download step, too, to prevent unnecessary downloads. - Emit a warning message when a file is not verified. Indicate that the file may be corrupt or that no checksum was specified.
* Fix up download a bit, better error checking and uses of long not double for ↵Bill Hoffman2009-10-221-1/+1
| | | | timeout as curl needs, bug# 9748
* 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.
* ENH: Create file(COPY) command signatureBrad King2009-04-291-1/+37
| | | | | | | | 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.
* ENH: Refactor file(INSTALL) implementationBrad King2009-04-291-24/+0
| | | | | | The undocumented file(INSTALL) is implemented by a cmFileInstaller class inside cmFileCommand. This refactors the class to split out code not specific to installation into a cmFileCopier base class.
* ENH: Send all file installations through one pathBrad King2009-04-291-4/+2
| | | | | | This creates a single cmFileInstaller method to dispatch installation of symlinks, directories, and files. The change removes duplicate tests of input file type and makes the decision more consistent.
* ENH: Remove unused PROPERTIES from file(INSTALL)Brad King2009-04-271-1/+0
| | | | | The undocumented file(INSTALL) command used to support a PROPERTIES option, but no install code still uses it. This removes the option.
* ENH: Create file(RENAME) command modeBrad King2009-04-151-0/+5
| | | | | This creates command "file(RENAME <oldname> <newname>)" to rename a file or directory within a single disk volume.
* ENH: Add undocumented file(DIFFERENT) commandBrad King2009-01-071-0/+1
| | | | | This new command will be used by generated installation scripts to determine whether an already-installed export file has changed.