| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring in commit bff468c988 (cmFileCommand: Use cm::optional for
keyword argument presence, 2022-06-30, v3.25.0-rc1~512^2) accidentally
broke the check that the input argument is either `INPUT` or `CONTENT`.
The check is supposed to fail when arguments are passed in the wrong
order. For example:
file(GENERATE OUTPUT ...
TARGET <target>
CONTENT <content>)
Prior to this fix, the input method would be CONTENT, but because the
first parsed keyword is not `CONTENT`, `inputIsContent` would be false.
The first parsed keyword isn't INPUT either, so we would not continue
into the error condition. CMake would then try to handle this as an
input file, when there isn't one, resulting in uninitialized memory
usage and segfaults or corruption later on.
Fixes: #25169
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
If a source file is not found, the error message reports a backtrace.
Previously the backtrace pointed at where the target was created.
In the case of `target_sources`, the missing source may have been
named elsewhere.
Fixes: #24538
|
|
|
|
|
|
|
|
| |
For policy-specific tests, use the version before the policy was
introduced. Otherwise, use 3.5 where possible.
Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
|
| |
|
| |
|
|
|
|
|
| |
We have long incorrectly accepted both of these together, and used only
the first one. Add a test to preserve compatibility.
|
|
|
|
| |
Detect MSYS as CYGWIN, with the required adaptations.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
769ff05483 Help: Clarify permission-related command options
900184616a Cleanup: Fix misspelt name of local C++ variable
635431a0c9 Tests: Check host platform instead of target for running stat
4ceb0ca59e Tests: Remove redundant files for configure_file() tests
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5945
|
| | |
|
|/ |
|
|
|
|
| |
Fixes: #19198
|
|
|
|
| |
Fixes: #15653
|
|
|
|
|
|
|
|
|
|
|
| |
The output file structures of file(GENERATE) have to be created early to
be able to use the generated files in source lists.
This was not done correctly for subdirectories which has been fixed
in commit aee2c51224 (file(GENERATE): Create output file structures for
all directories first, 2020-09-10).
Add a test case to address issue #21144.
|
|
|
|
|
|
|
| |
Adds TARGET argument to file(GENERATE) to make resolving generator expressions
requiring a target possible.
Implements #21101, fixes #21074.
|
|
|
|
|
|
|
|
|
| |
Output files get the source property `GENERATED` which is indirectly
checked by adding them to a library.
For a missing file that is not generated CMake will abort.
With the new behavior according CMP0070 relative files are generated
into the binary directory.
|
|
|
|
|
|
|
| |
Add the additional CMP0070 warning as expected stderr.
The warning occurs twice because the output file name is evaluated
multiple times.
|
|
|
|
| |
Fixes: #20873
|
|
|
|
| |
Use 3.3 or 2.8.12 where possible.
|
|
|
|
|
|
|
| |
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for policies
introduced in CMake 3.10 and below to encourage projects to port away
from setting policies to OLD.
|
|
|
|
|
| |
The geneator expression can now be used with static, shared, and
module libraries and executables.
|
| |
|
|
|
|
| |
Issue: #17435
|
|
|
|
|
| |
Simplify the `RunCMake.File_Generate` test `COMPILE_LANGUAGE-genex`
case to avoid requiring support for the genex in `COMPILE_OPTIONS`.
|
|
|
|
| |
The default result is "0" anyway.
|
|
|
|
|
|
|
|
|
| |
Previously `file(GENERATE)` did not define any behavior for relative
paths given to the `OUTPUT` or `INPUT` arguments. Define behavior
consistent with CMake conventions and add a policy to provide
compatibility for projects that relied on the old accidental behavior.
Fixes: #16786
|
|
|
|
|
| |
We don't define behavior for relative paths to the OUTPUT argument.
Fix our tests to use full paths.
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously the `TARGET_OBJECTS` generator expression was limited
only to use in a buildsystem context so that Xcode's placeholders
in object file paths can be evaluated. Lift this restriction so
that the expression can at least be used in most settings.
Co-Author: Brad King <brad.king@kitware.com>
|
|
|
|
|
|
|
|
| |
Move the diagnostic that rejects the TARGET_OBJECTS generator expression
in non-buildsystem context until after the check for whether the named
target is an object library. This order will makes more sense than the
previous order once TARGET_OBJECTS is allowed in non-buildsystem
context.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Adjust test for new error output.
|
|
|
|
|
| |
The default expectation of RunCMake tests is empty content, so there
is no need to specify it.
|
|
|
|
|
|
|
|
|
|
| |
Re-run if the input file changes or if the output file is removed.
This only works with the Makefile generators currently. The limitation
of the Ninja generator is tracked as issue #15256. The IDE
generators will need larger refactoring as they currently rely on
being able to determine the depends and output files at the start of
generate-time, which is too early for the file(GENERATE) case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The evaluation files must be known before cmTargetTraceDependencies
attempts to find them, but we must actually generate the files after
cmTargetTraceDependencies, as that can add to target SOURCES. The
limitation is that the generated output name must not depend on the
SOURCES of a target if the generated file is used by that target.
Mark the output files as GENERATED so that trace dependencies does
not expect them to already exist in the filesystem.
Move the invokation of ForceLinkerLanguage in the Generate logic
to after the generated file names are known. ForceLinkerLanguage
tries to determine the sources of a target (in order to determine
an already-known language) and otherwise fails to get information
about the generated file.
Test that the output of file(GENERATE) can be used as a target source
file and that accessing the target SOURCES in the name of the output
file is an error. Accessing the TARGET_OBJECTS would be a similar
error if it was legal to use that generator expression in this
context. That is not currently possible and is a different error
condition, so test the current error output as a reminder to change
the expected output if that becomes possible in the future. Test
that generated rule files resulting from cmTargetTraceDependencies
appear in the SOURCES generated in the output file.
|
| |
|
|
|
|
|
|
|
|
|
| |
The generator name is "Xcode", not "XCode". Fix this typo. Explicitly
exclude the SubDirSpaces test on Xcode because it does not work. Also
tell the RunCMake.File_Generate test when Xcode is not multi-config so
it can exlcude the OutputConflict case.
Inspired-by: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
|
|
|
|
|
| |
Drop use of RunCMake_TEST_FILE and pass the test file in through a
definition in RunCMake_TEST_OPTIONS.
|
|
|
|
| |
No policy is used to control this behavior for now.
|
|
|
|
|
|
| |
Set the minimum required version of CMake high enough to avoid the
warning for CMAKE_LEGACY_CYGWIN_WIN32. The warning appears on stderr
and breaks the expected output matching.
|
|
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.
|