Commit Graph

141 Commits

Author SHA1 Message Date
Brad King 953d34fd1f Help: Document MAIN_DEPENDENCY limitation in add_custom_command
Specify explicitly that at most one custom command may use a given
source file as its main dependency.
2014-12-16 10:38:43 -05:00
Brad King 9859042c05 Help: Mention add_dependencies in add_custom_target DEPENDS option
This will direct readers looking to add target-level dependencies.
2014-12-16 10:38:10 -05:00
Brad King 03db9a061a Merge topic 'doc-file-GENERATE-order'
fe21580b Help: Document file(GENERATE) signature option order
2014-12-05 14:01:04 -05:00
Brad King fe21580b84 Help: Document file(GENERATE) signature option order
In commit v3.1.0-rc1~484^2 (Help: Format and revise file() command
documentation, 2014-05-23) the signature of file(GENERATE) was
accidentally simplified too much and dropped specification of the
required argument ordering.  Restore the signature to make the order
clear.
2014-12-05 13:28:24 -05:00
Brad King d90e288b7b Merge topic 'file-LOCK-command'
93017828 Help: Add notes for topic 'file-LOCK-command'
e6db4c5a file: Add LOCK subcommand to do file and directory locking
05d6531c cmSystemTools: Add StringToInt helper
2014-12-03 10:02:07 -05: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
Gregor Jasny 0de867dde2 continue: Add a new CMake language command for loop continuation (#14013)
Inspired-by: Doug Barbieri
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-12-01 09:50:49 -05:00
Brad King 8e75f1d2fa Merge topic 'target-sources-error-conditions'
8a75c7ef Help: Document the export limitation of INTERFACE_SOURCES.
e1348056 Export: Disallow export of targets with INTERFACE_SOURCES
bb5905bb cmTarget: Don't allow relative paths in INTERFACE_SOURCES
2014-12-01 08:57:34 -05:00
Brad King 2a92231630 Merge topic 'doc-installed-file-property'
89bb34d3 Help: Add 3.1 release notes for INSTALL property scope
07254a81 Help: Document installed file property API
a1aceb25 Help: Format set_property and get_property command docs
2014-12-01 08:57:32 -05:00
Nils Gladitz 07254a8166 Help: Document installed file property API
Since commit v3.1.0-rc1~479^2~1 (Add an "installed file" property
scope, 2014-05-15) the get_property and set_property commands
support an 'INSTALL' scope.  Add documentation for this scope.
2014-12-01 08:48:19 -05:00
Brad King a1aceb2585 Help: Format set_property and get_property command docs 2014-12-01 08:47:58 -05:00
Stephen Kelly 8a75c7ef32 Help: Document the export limitation of INTERFACE_SOURCES. 2014-11-29 12:25:00 +01:00
Brad King 90cfed51f6 Merge topic 'improve-INTERFACE-property-docs'
bb1111ea Help: Warn that paths should not be used in INTERFACE_ build properties.
96691d12 Help: Fix typo in genex in documentation.
f8f02451 Help: Use a property-specific command instead of the generic one.
8609a884 Help: Make remaining build property docs consistent.
bcface39 Help: Link to target_link_libraries from target properies.
e12926e7 Help: Format the LINK_INTERFACE_LIBRARIES target properies.
c8540e94 Help: Unify the help text of INTERFACE_ build properties.
2014-11-25 10:18:52 -05:00
Brad King 0f19208076 Merge topic 'custom-command-byproducts'
557aef0b ExternalProject: Add options to specify BYPRODUCTS (#14963)
e15a7075 Add an option for explicit BYPRODUCTS of custom commands (#14963)
2014-11-25 10:18:16 -05:00
Stephen Kelly bb1111eaa2 Help: Warn that paths should not be used in INTERFACE_ build properties. 2014-11-25 10:00:35 -05:00
Brad King d4fdfaaef1 Merge branch 'doc-target_include_directories-fixup' into release 2014-11-17 15:16:35 -05:00
Brad King d903f7ce91 Merge topic 'doc-target_include_directories-fixup'
1d22ee67 Help: target_include_directories does not allow target names
2014-11-17 15:15:56 -05:00
Brad King 1d22ee67aa Help: target_include_directories does not allow target names
Since commit v2.8.11~227^2~1 (Don't allow targets args in the new target
commands, 2013-01-29) the target_include_directories command does not
support target names on the right hand side, but that commit forgot to
remove it from the docs.  It was never released with such support.
Update the command documentation now.
2014-11-17 14:47:42 -05:00
Brad King 444f61e044 Merge topic 'console-pool'
2d75d7e5 Help: Add notes for topic 'console-pool'
f42d86f0 Ninja: Implement USES_TERMINAL using the console pool if available
f281ae01 Ninja: Remove unused declaration
d5eae556 Ninja: factor out the test for console pool support
4d1fedf4 Give the interactive cache editor the USES_TERMINAL property
fe5d6e8c Add USES_TERMINAL option for custom commands
ad6ee426 Rename doing_verbatim to doing_nothing
2014-11-17 09:40:56 -05:00
Brad King 545d10cc67 Merge topic 'string-SUBSTRING-truncate'
474bbb9d string: Tolerate SUBSTRING length exceeding end index
2014-11-17 09:40:44 -05:00
Brad King e15a7075b5 Add an option for explicit BYPRODUCTS of custom commands (#14963)
A common idiom in CMake-based build systems is to have custom commands
that generate files not listed explicitly as outputs so that these
files do not have to be newer than the inputs.  The file modification
times of such "byproducts" are updated only when their content changes.
Then other build rules can depend on the byproducts explicitly so that
their dependents rebuild when the content of the original byproducts
really does change.

This "undeclared byproduct" approach is necessary for Makefile, VS, and
Xcode build tools because if a byproduct were listed as an output of a
rule then the rule would always rerun when the input is newer than the
byproduct but the byproduct may never be updated.

Ninja solves this problem by offering a 'restat' feature to check
whether an output was really modified after running a rule and tracking
the fact that it is up to date separately from its timestamp.  However,
Ninja also stats all dependencies up front and will only restat files
that are listed as outputs of rules with the 'restat' option enabled.
Therefore an undeclared byproduct that does not exist at the start of
the build will be considered missing and the build will fail even if
other dependencies would cause the byproduct to be available before its
dependents build.

CMake works around this limitation by adding 'phony' build rules for
custom command dependencies in the build tree that do not have any
explicit specification of what produces them.  This is not optimal
because it prevents Ninja from reporting an error when an input to a
rule really is missing.  A better approach is to allow projects to
explicitly specify the byproducts of their custom commands so that no
phony rules are needed for them.  In order to work with the non-Ninja
generators, the byproducts must be known separately from the outputs.

Add a new "BYPRODUCTS" option to the add_custom_command and
add_custom_target commands to specify byproducts explicitly.  Teach the
Ninja generator to specify byproducts as outputs of the custom commands.
In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets
that link, the byproducts must be specified as outputs of the link rule
that runs the commands.  Activate 'restat' for such rules so that Ninja
knows it needs to check the byproducts, but not for link rules that have
no byproducts.
2014-11-14 16:16:00 -05:00
Peter Collingbourne fe5d6e8c0f Add USES_TERMINAL option for custom commands
Teach the add_custom_command and add_custom_target commands a new
USES_TERMINAL option.  Use it to tell the generator to give the command
direct access to the terminal if possible.
2014-11-14 11:55:09 -05:00
Brad King 0cacf73959 Help: Document add_custom_command marking outputs GENERATED 2014-11-14 10:06:55 -05:00
Brad King 66ea634b4c Help: Revise and format 'add_custom_target' docs
Format the reStructuredText markup manually.  Organize the command
options into a definition list.  Use inline markup to cross-reference
related documents.
2014-11-13 11:52:54 -05:00
Domen Vrankar 474bbb9dbc string: Tolerate SUBSTRING length exceeding end index
string SUBSTRING command now ignores length if it points
past end of string and uses end of string instead.
String SUBSTRING tests now cover more corner cases.
2014-11-13 11:04:52 -05:00
Brad King 3d0addd965 Merge branch 'doc-install-SCRIPT-CODE-COMPONENT' into release 2014-11-13 10:21:53 -05:00
Brad King 8abba92472 Merge topic 'doc-install-SCRIPT-CODE-COMPONENT'
7361e810 Help: Document COMPONENT option of install(SCRIPT/CODE) (#14956)
2014-11-13 10:08:25 -05:00
Brad King 7361e8102a Help: Document COMPONENT option of install(SCRIPT/CODE) (#14956) 2014-11-13 08:41:56 -05:00
Brad King 4c8c442d7c Help: Fix broken cross-references reported by 'nitpicky' option
Enable the Sphinx 'nitpicky' option and fix the resulting warnings about
dangling references.
2014-11-07 11:41:21 -05:00
Brad King b71399a189 Merge branch 'release-doc-formatting' into release 2014-11-07 10:20:58 -05:00
Brad King f84ddd4b56 Help: Format add_library documented list of INTERFACE commands
Use a bullet list to make it easier to read.
2014-11-06 14:46:18 -05:00
Brad King aa0f6e8309 Merge branch 'doc-add_library-typo' into release 2014-10-31 11:38:36 -04:00
Nils Gladitz 38825396f9 Documentation: Fix minor typo thecommand -> the command 2014-10-31 11:27:50 -04:00
Brad King 8f01867340 Merge branch 'doc-add_compile_options' into release 2014-10-29 15:24:03 -04:00
Brad King 352cbb6e36 Help: Reference add_compile_options from add_definitions (#15225)
When we explain in add_definitions documentation that it is intended
only for preprocessor definitions, link to add_compile_options for
adding other flags.  Also explicitly mention that the order of
add_definitions calls with respect to target creation does not matter.
This differs from the behavior now explicitly stated in the
documentation of add_compile_options.
2014-10-29 15:23:31 -04:00
Brad King a9f8c50aa2 Help: Clarify add_compile_options documentation (#15225)
Explain that it affects only targets added after the call.  Fix the link
to the COMPILE_OPTIONS directory propert documentation.  Update the
latter to explain that it is used to initialize the corresponding target
property when a target is created.
2014-10-29 09:18:56 -04:00
Brad King 35ca4863aa Help: Wrap long ctest_submit signature line 2014-10-22 16:41:07 -04:00
Brad King 0f2defba7d Merge topic 'doc-set_test_properties-example'
d8054987 Help: Fix set_tests_properties documentation typo
2014-09-15 10:27:41 -04:00
Brad King 9edf6903e6 Merge topic 'if-sanity'
858d5a0b Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin
e177e7af FPHSA: Avoid if() dereferencing of quoted variable
425acc52 cmcurl: Use if(DEFINED) to simplify conditions
cede5cbd libarchive: Avoid depending on if() to dereference a quoted variable
2d97178b FindGTK2: Avoid depending on if() to dereference a quoted variable
0b12815d Modules/Test*.cmake: Use if(DEFINED) to simplify conditions
188a1f23 If: Introduce policy CMP0054 - don't dereference quoted variables in if()
b900c1cc If: Extract cmConditionEvaluator from if() implementation
2014-09-15 10:27:36 -04:00
Andrew Bauer d805498701 Help: Fix set_tests_properties documentation typo
The example for FAIL_REGULAR_EXPRESSION should actually name it.
2014-09-12 11:32:50 -04:00
Nils Gladitz 188a1f236e If: Introduce policy CMP0054 - don't dereference quoted variables in if() 2014-09-11 21:23:17 +02:00
Brad King 3d290c111a Merge topic 'string-uuid-doc-fix'
e6ba52e8 StringUuid: Mark UPPER flag optional in sub-command synopsis
2014-09-10 11:23:15 -04:00
Nils Gladitz e6ba52e8e0 StringUuid: Mark UPPER flag optional in sub-command synopsis 2014-09-10 16:10:13 +02:00
Brad King a5c6ae69f3 Merge topic 'doc-add_custom_command-multiple-commands'
1fdf4ff0 Help: Suggest in add_custom_command how to create a script (#15112)
2014-09-09 11:23:32 -04:00
Brad King 1fdf4ff06a Help: Suggest in add_custom_command how to create a script (#15112) 2014-09-08 14:17:36 -04:00
Brad King ecf43f0dc7 Merge topic 'doc-add_custom_command-multiple-commands'
412926d0 Help: Clarify add_custom_command multiple command behavior (#15112)
2014-09-04 09:48:32 -04:00
Alan W. Irwin abbe91c58c Help: Clarify --debug-trycompile usage with try_compile
Explain that try_compile calls need to be protected with conditions to
avoid running more than once so that it is easy to isolate a single
try_compile to perform with --debug-trycompile.
2014-09-03 11:19:52 -04:00
Brad King 412926d03a Help: Clarify add_custom_command multiple command behavior (#15112)
Explicitly say that the commands are not composed into a stateful
script.
2014-09-02 15:13:50 -04:00
Nils Gladitz 328e869433 StringUuid: Implement new string(UUID) sub-command. 2014-08-28 15:13:54 +02:00
Brad King a16a344b4b Merge topic 'doc-add_custom_command'
5bf1c5cc Help: Document add_custom_command PRE_BUILD/PRE_LINK for exe/lib only (#15059)
2a58c872 Help: Revise and format 'add_custom_command' docs
cb88742d Help: Remove stray content from 'add_custom_command' docs
2014-08-06 09:26:32 -04:00