summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* add_custom_{command,target}: Add COMMAND_EXPAND_LISTS optionEd Branch2017-01-141-1/+12
| | | | | | This option allows lists generated by generator expressions to be expanded. Closes: #15935
* clang-tidy: apply performance-faster-string-find fixesDaniel Pfeifer2016-12-121-1/+1
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+10
|
* 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.
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-103/+62
| | | | | | | | | | | | | 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.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Port to static cmPolicies API.Stephen Kelly2015-05-041-2/+1
|
* cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-2/+2
| | | | Match names used in CMake code.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-3/+3
| | | | All compilers hosting CMake support the std class.
* Add an option for explicit BYPRODUCTS of custom commands (#14963)Brad King2014-11-141-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add USES_TERMINAL option for custom commandsPeter Collingbourne2014-11-141-1/+15
| | | | | | 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.
* Rename doing_verbatim to doing_nothingPeter Collingbourne2014-11-141-2/+2
| | | | | We are about to introduce another property here, so give this a better name.
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Merge topic 'fix_policy_diagnostics'Brad King2014-04-011-3/+3
|\ | | | | | | | | 77b581c2 Policies: omit warnings about unset policies when they are actually set to NEW
| * Policies: omit warnings about unset policies when they are actually set to NEWNils Gladitz2014-03-311-3/+3
| |
* | Remove some c_str() calls.Stephen Kelly2014-03-111-5/+5
|/ | | | | | 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.
* CMP0037: Extend policy to reserved names and custom targetsNils Gladitz2013-11-191-7/+55
| | | | | | | | Teach add_custom_target to check the policy too. Extend the policy to disallow reserved target names that we use for builtin targets like "all". Extend the RunCMake.CMP0037 test to cover these cases.
* Drop compatibility with CMake < 2.4Brad King2013-10-231-11/+6
| | | | | | | | | | | | Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to a value lower than 2.4, and generate an error when projects or the user attempt to do so. In the error suggest using a CMake 2.8.x release. Teach cmake_minimum_required to warn about projects that do not require at least CMake 2.4. They are not supported by CMake >= 3.0. Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a reference to policy CMP0001.
* Normalize slashes of add_custom_(command|target) DEPENDS (#11973)Brad King2011-03-301-1/+5
| | | | | | | | | | | | | | | | All commands accepting file paths should normalize the slashes so that the string-represented names can be compared reliably. The commands add_library and add_executable have done this for years. We taught add_custom_command to normalize its OUTPUT names in commit a75a0a14 (Normalize add_custom_command OUTPUT names, 2010-12-15). We handled a special case of the DEPENDS option in commit 7befc007 (Handle trailing slashes on add_custom_command DEPENDS, 2011-01-26). Teach both add_custom_command and add_custom_target to normalize slashes of DEPENDS files up front. This approach subsumes the above-mentioned special case so remove the one line added for it but keep its test. Extend the CustomCommand test to check that slash count mismatches between custom command OUTPUT and DEPENDS can still be linked correctly.
* Handle relative WORKING_DIRECTORY in add_custom_(command|target)Brad King2011-01-261-0/+8
| | | | This also fixes handling of trailing slashes in the directory name.
* 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: Allow custom sources in custom targetsBrad King2008-10-091-3/+16
| | | | | | | This adds a SOURCES option to ADD_CUSTOM_TARGET, enabling users to specify extra sources for inclusion in the target. Such sources may not build, but will show up in the IDE project files for convenient editing. See issue #5848.
* COMP: Fix unused parameter warning in cmAddCustomTargetCommand.Brad King2008-03-071-1/+1
|
* ENH: Improve handling of old-style compatibility.Brad King2008-03-071-38/+19
| | | | | | | | | | | | | | | | | | | - Remove CMP_0001 (no slash in target name) and restore old CMAKE_BACKWARDS_COMPATIBILITY check for it - Replace all checks of CMAKE_BACKWARDS_COMPATIBILITY with cmLocalGenerator::NeedBackwardsCompatibility calls - Create new CMP_0001 to determine whether or not CMAKE_BACKWARDS_COMPATIBILITY is used. (old = use, new = ignore) - Show CMAKE_BACKWARDS_COMPATIBILITY in cache only when CMP_0001 is set to OLD or WARN - Update documentation of cmake_policy and cmake_minimum_required to indicate their relationship and the 2.4 version boundary - When no cmake policy version is set in top level makefile implicitly call cmake_policy(VERSION 2.4) which restores CMAKE_BACKWARDS_COMPATIBILITY and other 2.4 compatibility - Fix tests MakeClean and Preprocess to call cmake_policy(VERSION 2.6) because they depend on new policies
* ENH: New format for warning and error messagesBrad King2008-03-071-6/+8
| | | | | | | | | | | | | - Add cmMakefile methods IssueError and IssueWarning - Maintain an explicit call stack in cmMakefile - Include context/call-stack info in messages - Nested errors now unwind the call stack - Use new mechanism for policy warnings and errors - Improve policy error message - Include cmExecutionStatus pointer in call stack so that errors deeper in the C++ stack under a command invocation will become errors for the command
* ENH: fix ICE with gcc in dash8Bill Hoffman2008-03-031-7/+12
|
* COMP: fix compile errors on vs6 and a warningKen Martin2008-03-021-1/+0
|
* COMP: fix some warningsKen Martin2008-03-011-0/+1
|
* ENH: add first cut and policies still need to add the doc supportKen Martin2008-03-011-19/+25
|
* ENH: Add global property ALLOW_DUPLICATE_CUSTOM_TARGETS to help existing ↵Brad King2008-02-141-1/+1
| | | | projects that depend on having duplicate custom targets. It is allowed only for Makefile generators. See bug#6348.
* COMP: Fix shadowed local variable warning.Brad King2008-02-111-0/+2
|
* ENH: Enforce global target name uniqueness.Brad King2008-02-111-0/+8
| | | | | | | | - Error if imported target is involved in conflict - Error for non-imported target conflict unless CMAKE_BACKWARDS_COMPATIBILITY <= 2.4 - Include OUTPUT_NAME property in error message - Update add_executable and add_library command documentation
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-2/+2
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* ENH: some more cleanupKen Martin2007-03-131-3/+3
|
* ENH: Added COMMENT option to ADD_CUSTOM_TARGET. This addresses bug#3461.Brad King2006-10-041-1/+12
|
* ENH: Cleaned up signature of cmMakefile::AddUtilityCommand. It is not valid ↵Brad King2006-09-281-2/+1
| | | | to have an output from a utility rule and no calls to the method asked for an output anyway. The argument has been removed.
* ENH: Added VERBATIM option to ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET ↵Brad King2006-09-281-2/+10
| | | | commands. This option enables full escaping of custom command arguments on all platforms. See bug#3786.
* ENH: Added diagnosis of bad target names.Brad King2006-09-131-0/+23
|
* STYLE: some m_ to this-> cleanupKen Martin2006-03-151-3/+3
|
* STYLE: Fix some style issuesAndy Cedilnik2006-03-101-4/+5
|
* ENH: fix broken testsBill Hoffman2006-02-081-1/+1
|
* ENH: add working directory supportBill Hoffman2006-02-081-2/+12
|
* ENH: Added check for invalid characters in output name.Brad King2005-03-221-0/+10
|
* ENH: Updated implementation of custom commands. Multiple command lines are ↵Brad King2005-02-221-31/+67
| | | | now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues.
* BUG: Fixed check of number of arguments.Brad King2004-04-211-1/+1
|
* fixed argument parsingKen Martin2003-11-131-1/+1
|
* yikes added new custom command supportKen Martin2003-06-031-2/+13
|
* ENH: Moved ExpandListVariables out of individual commands. Argument ↵Brad King2002-12-111-4/+2
| | | | evaluation rules are now very consistent. Double quotes can always be used to create exactly one argument, regardless of contents inside.