html c:if,if — CMake 3.0.2 Documentation

if()True if the constant is 1, ON, YES, TRUE, Y,

or a non-zero number. False if the constant is 0, OFF,

NO, FALSE, N, IGNORE, NOTFOUND, the empty string,

or ends in the suffix -NOTFOUND. Named boolean constants are

case-insensitive. If the argument is not one of these constants, it

is treated as a variable.

if()True if the variable is defined to a value that is not a false

constant. False otherwise. (Note macro arguments are not variables.)

if(NOT )True if the expression is not true.

if( AND )True if both expressions would be considered true individually.

if( OR )True if either expression would be considered true individually.

if(COMMAND command-name)True if the given name is a command, macro or function that can be

invoked.

if(POLICY policy-id)True if the given name is an existing policy (of the form CMP).

if(TARGET target-name)True if the given name is an existing logical target name such as those

created by the add_executable(), add_library(), or

add_custom_target() commands.

if(EXISTS path-to-file-or-directory)True if the named file or directory exists. Behavior is well-defined

only for full paths.

if(file1 IS_NEWER_THAN file2)True if file1 is newer than file2 or if one of the two files doesn’t

exist. Behavior is well-defined only for full paths. If the file

time stamps are exactly the same, an IS_NEWER_THAN comparison returns

true, so that any dependent build operations will occur in the event

of a tie. This includes the case of passing the same file name for

both file1 and file2.

if(IS_DIRECTORY path-to-directory)True if the given name is a directory. Behavior is well-defined only

for full paths.

if(IS_SYMLINK file-name)True if the given name is a symbolic link. Behavior is well-defined

only for full paths.

if(IS_ABSOLUTE path)True if the given path is an absolute path.

if( MATCHES regex)True if the given string or variable’s value matches the given regular

expression.

if( LESS )True if the given string or variable’s value is a valid number and less

than that on the right.

if( GREATER )True if the given string or variable’s value is a valid number and greater

than that on the right.

if( EQUAL )True if the given string or variable’s value is a valid number and equal

to that on the right.

if( STRLESS )True if the given string or variable’s value is lexicographically less

than the string or variable on the right.

if( STRGREATER )True if the given string or variable’s value is lexicographically greater

than the string or variable on the right.

if( STREQUAL )True if the given string or variable’s value is lexicographically equal

to the string or variable on the right.

if( VERSION_LESS )Component-wise integer version number comparison (version format is

major[.minor[.patch[.tweak]]]).

if( VERSION_EQUAL )Component-wise integer version number comparison (version format is

major[.minor[.patch[.tweak]]]).

if( VERSION_GREATER )Component-wise integer version number comparison (version format is

major[.minor[.patch[.tweak]]]).

if(DEFINED )True if the given variable is defined. It does not matter if the

variable is true or false just if it has been set. (Note macro

arguments are not variables.)

if((expression) AND (expression OR (expression)))The expressions inside the parenthesis are evaluated first and then

the remaining expression is evaluated as in the previous examples.

Where there are nested parenthesis the innermost are evaluated as part

of evaluating the expression that contains them.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值