summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
Commit message (Collapse)AuthorAgeFilesLines
* add_subdirectory: Add SYSTEM optionDa Quexian2022-09-261-1/+1
| | | | | Fixes: #22401 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* clang-tidy: address `modernize-use-default-member-init` lintsBen Boeckel2022-05-241-2/+2
|
* Trace: process else and elseif commands correctlyBraulio Valdivielso Martinez2022-03-251-2/+9
| | | | | | | | | | | | | | | | | There have been two bugs reported about the `else` and `elseif` commands in the context of the tracing functionality and the json-v1 format (#23191 #22315). In essence, the reported traces referred to the layer of the stacktrace immediately on top of the expected ones. This MR fixes both issues. My solution adds a new parameter to the `PrintCommandTrace` function, `commandMissingFromStack`, that callers can specify if the command they want to report a trace for is not a regular part of the stack maintained in `cmMakefile`. This is only the case for `else` and `elseif`. The other bug is fixed by having the caller pass a `cmListFileBacktrace`, which helps in getting the right lines, file names... for the reported command. Fixes: #23191 #22315
* cmMakefile: Add missing initializer for recently added memberBrad King2022-03-151-1/+1
| | | | | | | In commit 2f1ffa003c (find_package: Add support for default GLOBAL imported targets, 2022-03-10) we added a field without an initializer. This was exposed by a few failures in nightly testing. Previously it worked only by chance that the member's memory had suitable values.
* find_package: Add support for default GLOBAL imported targetsJohn Parent2022-03-101-0/+39
| | | | | | | | | Allow find package to promote scope of imported targets by specifying an argument to `find_package` or by specifying a CMake variable. * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable * Add support for GLOBAL argument to find_package Additionally add testing for above features.
* Merge topic 'debug-find'Brad King2022-02-111-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 38de1bef2d find_package: Improve --debug-find-pkg= when using a find module d634d20397 find_package: Avoid printing debug output header multiple times df3e29450a find_package: Mention package name in Config mode debug output 636ca7f25c find_package: Fix find module name in --debug-find output 596e185409 find_package: Improve formatting of --debug-find output 2f43527574 Tests: Improve order of RunCMake.find_package cases a690523fcf cmFindPackageCommand: Drop ComputeIfDebugModeWanted overload Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6973
| * find_package: Improve --debug-find-pkg= when using a find moduleBrad King2022-02-101-0/+14
| | | | | | | | | | | | | | | | | | Extend the feature added by commit d7b18895bc (cmake: Add filtered debug-find options, 2021-12-07, v3.23.0-rc1~217^2) to enable debug output for `find_*` calls within a find module or cmake package configuration file. Fixes: #23211
* | Genex: Add $<LINK_LIBRARY:...>Marc Chevrier2022-02-071-0/+1
|/ | | | | | | | This generator expression offers the capability, for the link step, to decorate libraries with prefix/suffix flags and/or adding any specific flag for each library. Fixes: #22812, #18751, #20078, #22703
* cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-1/+1
| | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* cmMakefile: Simplify Add*Command and adopt to cmAddCustom*CommandNAKAMURA Takumi2021-11-181-36/+8
|
* cmMakefile: Simplify detail:::Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-1/+14
| | | | | | | | | Note 1: `detail::AddCustomCommandToTarget()` resets cc, since cc is not moved away. Note 2: In `detail::AddUtilityCommand()`, a few vars are preserved before using. Their refs will be alive in most cases, but cc might be destroyed in the future.
* cmMakefile: Introduce GeneratorAction as the class.NAKAMURA Takumi2021-11-181-3/+24
|
* cmMakefile: Move CMP0116 lookup into Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-18/+16
| | | | Avoid repeating it at every call site.
* Rename cmProp in cmValueMarc Chevrier2021-09-211-7/+7
|
* cmProp: cm::string_view cast operator must be explicitMarc Chevrier2021-09-141-0/+4
| | | | | | | To avoid ambiguity on std::string assigment between the following two cmProp cast operators: * operator const std::string&() const noexcept * operator cm::string_view() const noexcept
* Refactor: Convert parallel string/backtrace vectors to BT vectorsKyle Edwards2021-09-031-11/+5
|
* Enhancement: SetProperty accept cmProp or std::stringMarc Chevrier2021-08-251-0/+5
| | | | | Methods SetProperty of classes cmPropertyMap, cmStateDirectory and cmMakefile accept now cmProp or std::string as argument.
* Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-4/+4
|
* cmMakefile: Split out CreateNewTarget from AddNewTargetNAKAMURA Takumi2021-07-081-0/+5
| | | | `CreateNewTarget` tells whether the target is inserted or not.
* cmMakefile: Add helper to initialize CMAKE_CONFIGURATION_TYPESBrad King2021-06-301-0/+2
| | | | | Factor out duplicate code from the Ninja Multi-Config, Visual Studio, and Xcode generators.
* Source: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-1/+1
|
* foreach(): loop variables are only available in the loop scopeMarc Chevrier2021-04-281-0/+1
| | | | Fixes: #20553
* cmCustomCommand: Record value of CMP0116 at time of creationKyle Edwards2021-02-231-16/+18
|
* file(GENERATE): Support new line styleAsit Dhal2021-02-011-1/+2
| | | | Fixes: #19198
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+1
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* file(GENERATE): Support options to manipulate file permissionsAsit Dhal2020-12-211-1/+1
| | | | Fixes: #15653
* cmLocalGenerator: Adopt custom target 'force' output name generationBrad King2020-12-151-5/+0
|
* cmMakefile: Simplify custom target 'force' output name generationBrad King2020-12-151-2/+2
| | | | | | | | | | | | | | | Remove unnecessary check of policy CMP0049. The policy can never trigger on our internally-generated name because it has no variable references. The rename in commit 0ed5ce4cd8 (cmTarget: Rename AddSource method for backward compatibility., 2014-03-17, v3.1.0-rc1~688^2~17) made it look like this code path depended on CMP0049. Then commit 0e1faa28cb (cmMakefile: Separate custom command setup from actual creation, 2019-09-14, v3.16.0-rc1~85^2) and commit ea1bed34b2 (cmMakefile: Extract utilities used for creation of custom commands, 2019-09-21, v3.16.0-rc1~52^2~1) built additional infrastructure to thread that dependence through the call stack. Remove it all.
* Reduce the scope of temporary cmProp variables and other improvementsVitaly Stakhovsky2020-11-051-2/+1
|
* configure_file: Add option for user defined permissionsAsit Dhal2020-10-241-2/+3
| | | | | | | User defined permissions and options to copy permissions are implemented. Fixes: #20866
* Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-5/+5
|
* cmMakefile: Consolidate CreateGenerated{Outputs,Byproducts}Brad King2020-10-081-1/+0
| | | | | The implementations of these two methods are now identical, so combine them.
* cmLocalGenerator: Migrate custom command output lookup from cmMakefileBrad King2020-10-081-75/+5
| | | | | | | Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. Therefore we do not need to look up what source file holds the custom command producing a given output until generate time.
* cmMakefile: Drop unnecessary custom command APPEND checkBrad King2020-10-081-11/+1
| | | | | | | Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. This includes the append-to-non-existing-command check, so we do not need it at configure time.
* cmake_language: Add signature to DEFER calls to later timesBrad King2020-09-291-4/+33
| | | | Fixes: #19575
* cmMakefile: Clarify name of internal list file run methodBrad King2020-09-291-2/+2
|
* cmMakefile: Replace GetExecutionFilePath with the top of the BacktraceBrad King2020-09-281-2/+0
| | | | | | The execution file path stack and the backtrace stack are kept in sync. At all call sites of `GetExecutionFilePath`, the execution file path matches the path in the context at the top of the backtrace stack.
* cmMakefile: Simplify ExpandArguments signatureBrad King2020-09-281-5/+2
| | | | | | | | | | | The only call sites that pass the explicit file name argument are in function blocker `ArgumentsMatch` methods for `function` and `macro`. We already ensure that they are balanced within a file scope, and the RAII helpers `BuildsystemFileScope` and `ListFileScope` ensure that the backtrace and execution list file stacks unwind to the matching level. Therefore we can assume that the file name where we are checking for matching arguments matches starting file name where those arguments first appeared, and do not need to pass it explicitly.
* cmMakefile: Remove now-unused overload of GetBacktraceBrad King2020-09-281-1/+0
|
* cmMakefile: Inline GetExecutionContext at call sitesBrad King2020-09-281-1/+0
| | | | | The method only had one line, and its implementation is more clear at the call sites than the method name.
* Merge topic 'GetExecutionListFile-by-ref'Brad King2020-09-081-1/+1
|\ | | | | | | | | | | | | 879bd7fd9c cmStateSnapshot: Return const reference from GetExecutionListFile() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5186
| * cmStateSnapshot: Return const reference from GetExecutionListFile()Oleksandr Koval2020-09-031-1/+1
| |
* | 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.
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+1
|
* file(GENERATE): Add TARGET argumentRaul Tambre2020-08-201-1/+1
| | | | | | | Adds TARGET argument to file(GENERATE) to make resolving generator expressions requiring a target possible. Implements #21101, fixes #21074.
* Merge topic 'refactor-generator-configs'Brad King2020-07-061-4/+11
|\ | | | | | | | | | | | | 7a969fe21d cmMakefile: Refactor API to better handle empty config values Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4957
| * cmMakefile: Refactor API to better handle empty config valuesRobert Maynard2020-07-031-4/+11
| |
* | cmStandardLevelResolver: Added to handle standard level queriesRobert Maynard2020-07-011-86/+0
|/ | | | Refactored out of cmMakefile
* Merge topic 'remove-warn-unused-vars'Craig Scott2020-07-011-7/+0
|\ | | | | | | | | | | | | | | df6b077625 cmake: Remove broken '--warn-unused-vars' option Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !4953
| * cmake: Remove broken '--warn-unused-vars' optionBrad King2020-06-291-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This option has been broken since commit b9f9915516 (cmMakefile: Remove VarUsageStack., 2015-05-17, v3.3.0-rc1~52^2). That commit removed the check that an initialized variable has actually been used and caused the option to warn on every variable ever set. This was not caught by the test suite because the test for the feature only checked that warnings appear when needed and not that they do not appear when not needed. The option was never very practical to use. Remove it to avoid the runtime cost of usage tracking and checks for every variable (which we were doing even when the option was not used).