Commit Graph

70 Commits

Author SHA1 Message Date
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
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.
2016-05-16 16:05:19 -04:00
Ruslan Baratov e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
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.
2014-12-03 09:47:44 -05:00
Ben Boeckel 85fc9f26a7 stringapi: Command names 2014-03-08 13:05:39 -05:00
Brad King e33d8d2d77 Drop builtin command documentation
Drop all GetTerseDocumentation and GetFullDocumentation methods from
commands.  The command documentation is now in Help/command/*.rst files.
2013-10-16 09:22:36 -04:00
Stephen Kelly e454cba292 Docs: Document file(GENERATE) CONDITION as optional. 2013-07-26 00:21:50 +02:00
Stephen Kelly b983a58bdf file: Add GENERATE command to produce files at generate time
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.
2013-05-24 09:02:45 -04:00
David Cole d842d90622 CMake: Stylistic changes and documentation tweaks
...for the contributed file and string TIMESTAMP sub-commands.
2012-12-05 10:39:11 -05:00
Nils Gladitz 711e2b3b5c CMake: Add TIMESTAMP subcommand to string and file commands 2012-12-05 10:39:10 -05:00
Andreas Mohr 07d5e4b871 Documentation: Clarify some command descriptions
- 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
2012-11-07 14:10:56 -05:00
Brad King 95a0011604 file(DOWNLOAD): Change EXPECTED_HASH to take ALGO=value
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.
2012-09-19 11:31:36 -04:00
Brad King 131d91a1f9 Rename SSL terminology to TLS
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.
2012-09-14 15:40:09 -04:00
Bill Hoffman e1c89f08bb file(DOWNLOAD): Add options for SSL
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.
2012-09-11 15:34:54 -04:00
Bill Hoffman 34567dfc0d file(DOWNLOAD): Generalize EXPECTED_MD5 to EXPECTED_HASH
Add support for SHA algorithms.
2012-09-11 08:58:29 -04:00
Rolf Eike Beer edd8996fb4 FILE: mention that TO_CMAKE_PATH also handles list delimiters 2012-03-30 00:41:48 +02:00
Yury G. Kudryashov 737c49a357 Add 'const' qualifier to some cmCommand members
Use const_cast for the special case in cmFindBase where
GetFullDocumentation calls GenerateDocumentation.
2012-02-29 13:27:04 -05:00
Brad King 38771d3bdf Add file(SHA*) commands to compute cryptographic hashes
Add a file() command API for SHA1, SHA224, SHA256, SHA384, and SHA512.
2011-11-16 10:15:44 -05:00
Brad King 042f7965c3 Add file(MD5) command to compute cryptographic hash
Provide a CMake-language binding to the md5sum function previously
available only by "cmake -E md5sum".
2011-11-16 10:15:01 -05:00
Brad King faa7ec6e18 Teach file(DOWNLOAD|UPLOAD) to timeout after inactivity
Add option INACTIVITY_TIMEOUT to terminate the operation if there is no
progress for more than a given amount of time.
2011-06-01 09:55:42 -04:00
David Cole 963bebcc17 Implement file(UPLOAD (#11286)
Including documentation and testing, of course.
2011-02-25 17:26:34 -05:00
Brad King 26cc29a8e2 Warn in find(GLOB) docs about bad use case (#11617)
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
2010-12-16 15:49:32 -05:00
David Cole f67139ae6f Improve FILE(DOWNLOAD) and ExternalProject.
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.
2010-05-27 12:21:56 -04:00
Bill Hoffman 44c4600ae5 Fix up download a bit, better error checking and uses of long not double for timeout as curl needs, bug# 9748 2009-10-22 09:44:58 -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
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 6aaa7d45bf ENH: Refactor file(INSTALL) implementation
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.
2009-04-29 13:12:58 -04:00
Brad King 97263b6cdd ENH: Send all file installations through one path
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.
2009-04-29 08:47:13 -04:00
Brad King da993b64ce ENH: Remove unused PROPERTIES from file(INSTALL)
The undocumented file(INSTALL) command used to support a PROPERTIES
option, but no install code still uses it.  This removes the option.
2009-04-27 13:20:57 -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 f074d9f571 ENH: Add undocumented file(DIFFERENT) command
This new command will be used by generated installation scripts to
determine whether an already-installed export file has changed.
2009-01-07 14:16:35 -05:00
Bill Hoffman 269ce52ad5 BUG: fix spelling 2008-12-18 21:52:46 -05:00
David Cole bd1935dcd1 ENH: Improve FILE GLOB_RECURSE handling of symlinks with a new CMake policy. CMP0009 establishes NEW default behavior of not recursing through symlinks. OLD default behavior or explicit FOLLOW_SYMLINKS argument to FILE GLOB_RECURSE will still recurse through symlinks. 2008-09-11 14:34:04 -04:00
David Cole 0f2fa9a27f BUG: Correct typo in documentation: or -> of 2008-08-23 13:47:24 -04:00
David Cole ccf603f0c2 ENH: Add the RECURSE_SYMLINKS_OFF flag to the FILE GLOB_RECURSE command. Exposes the recently added kwsys capability that prevents recursing through symlinks to CMake scripts. 2008-08-23 13:33:13 -04:00
Brad King 1381aab4b7 BUG: Remove check for files written by file(WRITE) being loaded.
- CMake 1.8 and below did not do the check but could get in
    infinite loops due to the local generate step.
  - CMake 2.0 added the check but failed to perform it in directories
    with no targets (see bug #678).
  - CMake 2.2 removed the local generate which fixed the problem but
    did not remove the check.
  - Between CMake 2.4 and 2.6.0rc6 the check was fixed to work even
    when no targets appear in a directory (see bug #6923).
  - Bottom line: the check is no longer needed.
2008-04-30 13:42:40 -04:00
Brad King fdc3bfff7c ENH: Improve RPATH behavior during installation.
- If new RPATH is empty then remove the entry completely
  - Preserve file modification time so installation is not repeated
  - If installed file already exists remove it if its RPATH
    does not match that expected
2008-04-14 15:02:44 -04:00
Brad King 34c76d4304 ENH: Use builtin chrpath instead of relinking ELF targets
- Add cmSystemTools::ChangeRPath method
  - Add undocumented file(CHRPATH) command
  - When installing use file(CHRPATH) to change the rpath
    instead of relinking
  - Remove CMAKE_CHRPATH lookup from CMakeFindBinUtils
  - Remove CMAKE_USE_CHRPATH option since this should
    always work
2008-03-01 12:51:07 -05:00
Bill Hoffman 0bfad2946d ENH: make sure files are binary for download and make status a pair of value string 2008-02-07 13:26:16 -05:00
Bill Hoffman 7dfcc3fc12 ENH: add DOWNLOAD option to FILE command 2008-02-06 09:35:02 -05: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
Alexander Neundorf 7b54af713d ENH: add the keywords OFFSET and HEX to the FILE() command, using OFFSET an
offset can be specified where the reading starts, and using HEX the data can
be converted into a hex string, so binary data can be compared with text
functions
-add docs for LIMIT, OFFSET and HEX

Alex
2008-01-02 16:46:38 -05:00
Ken Martin 8d32d229a3 ENH: make commands lower case by default 2007-10-10 11:47:43 -04:00
Brad King e25dd3b903 COMP: Remove unused argument. 2007-07-02 16:04:15 -04:00
Brad King 7f29f8966d ENH: Further cleanup of installation script generation. The per-component and per-configuration testing is now done in cmake code instead of in the FILE(INSTALL) command. The generation of the cmake code to do these tests is centralized in cmInstallGenerator. Old-style shared library versioning and component/config support code has been removed from FILE(INSTALL). This commit is surrounded by the tags CMake-InstallGeneratorCleanup2-pre and CMake-InstallGeneratorCleanup2-post. 2007-07-02 14:56:57 -04:00
Brad King c0d3ab2d2b BUG: Need to compute the correct versioned name for executables on cygwin. This addresses bug#5238. 2007-06-27 16:10:39 -04:00
Alexander Neundorf 698ca6e956 STYLE: add documentation for FILE(REMOVE ...) and FILE(REMOVE_RECURSE ...)
FILE(REMOVE ...) works only for files, not for directories, REMOVE_RECURSE
works for both, it seems having both is not necessary

Alex
2007-06-13 14:36:26 -04:00
Alexander Neundorf b956fc2406 STYLE: remove out commented code
Alex
2007-06-07 13:51:17 -04:00
Alexander Neundorf 55f11b348b 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
2007-05-25 16:46:50 -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
Alexander Neundorf 61d3444f93 ENH: merge CMake-CrossCompileBasic to HEAD
-add a RESULT_VARIABLE to INCLUDE()
-add CMAKE_TOOLCHAIN_FILE for specifiying your (potentially crosscompiling) toolchain
-have TRY_RUN() complain if you try to use it in crosscompiling mode (which were compiled but cannot run on this system)
-use CMAKE_EXECUTABLE_SUFFIX in TRY_RUN(), probably TRY_RUN won't be able to
run the executables if they have a different suffix because they are
probably crosscompiled, but nevertheless it should be able to find them
-make several cmake variables presettable by the user: CMAKE_C/CXX_COMPILER, CMAKE_C/CXX_OUTPUT_EXTENSION, CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_INFO_FILE
-support prefix for GNU toolchains (arm-elf-gcc, arm-elf-ar, arm-elf-strip etc.)
-move ranlib on OSX from the file command to a command in executed in cmake_install.cmake
-add support for stripping during install in cmake_install.cmake
-split out cl.cmake from Windows-cl.cmake, first (very incomplete) step to support MS crosscompiling tools
-remove stdio.h from the simple C program which checks if the compiler works, since this may not exist for some embedded platforms
-create a new CMakeFindBinUtils.cmake which collects the search fro ar, ranlib, strip, ld, link, install_name_tool and other tools like these
-add support for CMAKE_FIND_ROOT_PATH for all FIND_XXX commands, which is a
list of directories which will be prepended to all search directories, right
now as a cmake variable, turning it into a global cmake property may need
some more work
-remove cmTestTestHandler::TryExecutable(), it's unused
-split cmFileCommand::HandleInstall() into slightly smaller functions

Alex
2007-05-17 13:20:44 -04:00
Brad King 0fb689973e ENH: Added FILE(STRINGS) command. 2007-04-25 17:22:07 -04:00