mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 04:09:33 -05:00
if: Add "TEST <test>" condition
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.
This commit is contained in:
committed by
Brad King
parent
623dcc85a4
commit
14e49ed156
@@ -71,6 +71,10 @@ Possible expressions are:
|
||||
created by the :command:`add_executable`, :command:`add_library`, or
|
||||
:command:`add_custom_target` commands.
|
||||
|
||||
``if(TEST test-name)``
|
||||
True if the given name is an existing test name created by the
|
||||
:command:`add_test` command.
|
||||
|
||||
``if(EXISTS path-to-file-or-directory)``
|
||||
True if the named file or directory exists. Behavior is well-defined
|
||||
only for full paths.
|
||||
|
||||
Reference in New Issue
Block a user