| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Document and add explicit tests for empty string input:
`if(EXISTS "")` and `if(IS_DIRECTORY "")` are always false.
This avoids need for users to do extra checks due to
CMake non-short-circuit logic as below:
if("${p}")
if(EXISTS "${p}")
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
da2361ffb3 while: Restore tolerance of condition error
47d197745a Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7041
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The wording update in commit b74819e4fe (Help: Format 'if' command
documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that
`AND` has higher precedence than `OR`. Although this is common in many
languages, it has never been true in CMake's implementation. Revise
the wording to clarify the precedence.
Add a test case demonstrating the order.
Fixes: #23207
|
|
|
|
|
|
|
|
| |
As reported in the BUG #22524, mismatched parenthesis reported differently
for `while()` and `if()`.
The problem was in the double loop (over "handlers" and the arguments),
where the outer loop didn't check the result of the running handler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `cmArgumentList` has been turned into a class (forward declared in
the header). It inherits from the `std::list` (yeah, but we don't intend
to store polymorphic classes in it). In addition to the standard methods,
now it's possible to move `HandlePredicate` (renamed to `ReduceOneArg`)
and `HandleBinaryOp` (renamed to `ReduceTwoArgs`) as its members.
Additionally, iterators managements (`IncrementArguments`) have been
refactored into two separate classes mimicking iterators. This also
allows having a uniform `for` loop and concentrates the logic of
iterators advancing in it instead of the loop's body. The arguments
processing algorithms operate with "windows" over a collection of
arguments. Hence there are two kinds of "iteration windows" -- allowing
to observe 2 or 3 elements per loop iteration. These iteration "windows"
also passed to reducers.
|
|
|
|
| |
Fixes: #19153
|
|
|
|
| |
Use 3.3 or 2.8.12 where possible.
|
|
|
|
| |
Closes: #14335
|
|
|
|
|
|
|
| |
Automate with:
find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
|
|
|
|
|
|
|
|
|
|
|
| |
While evaluating `if(MATCHES)` we get a `const char*` pointer to the
string to be matched. On code like
if(CMAKE_MATCH_COUNT MATCHES "Y")
the string to be matched may be owned by our own result variables.
We must move the value to our own buffer before clearing them.
Otherwise we risk reading freed storage.
|
|
|
|
|
|
|
|
| |
if(TEST TestNameThatExists) will return true if a test with the name
TestNameThatExists has been added with add_test. The syntax is similar
to if(TARGET TargetName). Since use of "TEST" as an argument to if()
could previously be interpreted as a non-keyword argument, add policy
CMP0064 to treat it as a keyword as NEW behavior.
|
|
|
|
|
|
|
| |
Move failure cases from the CMake.{If,List,While,GetProperty} tests over
to the RunCMake.{if,list,while,get_property} tests to use the more
modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to
try to regex-match full paths.
|
| |
|
|
|
|
|
|
| |
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.
|
|
Add a RunCMake.if test to cover if() command behavior. Start with a
test for IS_DIRECTORY cases with an existing directory and a long path,
both with a trailing slash.
|