OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
doc
/
cmake
/
html
/
command
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
π
..
-
04/04/2023 07:10:48 PM
rwxr-xr-x
π
add_compile_definitions.html
8.97 KB
04/04/2023 07:04:57 PM
rw-r--r--
π
add_compile_options.html
13.11 KB
04/04/2023 07:04:57 PM
rw-r--r--
π
add_custom_command.html
67.2 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_custom_target.html
26.7 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_definitions.html
9.72 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_dependencies.html
8.79 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_executable.html
20.23 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_library.html
43.25 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_link_options.html
17.79 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_subdirectory.html
8.85 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
add_test.html
17.09 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
aux_source_directory.html
6.45 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
block.html
13.15 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
break.html
5.97 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
build_command.html
10.66 KB
04/04/2023 07:04:58 PM
rw-r--r--
π
build_name.html
6.43 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_host_system_information.html
38.46 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_language.html
59.74 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_minimum_required.html
13.56 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_parse_arguments.html
18.62 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_path.html
80.45 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
cmake_policy.html
23.14 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
configure_file.html
20.36 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
continue.html
6.15 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
create_test_sourcelist.html
7.61 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_build.html
14.87 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_configure.html
10.28 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_coverage.html
9.93 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_empty_binary_directory.html
5.54 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_memcheck.html
11.73 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_read_custom_files.html
5.78 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_run_script.html
6.72 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_sleep.html
5.66 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_start.html
14.68 KB
04/04/2023 07:04:59 PM
rw-r--r--
π
ctest_submit.html
16.18 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
ctest_test.html
38.64 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
ctest_update.html
8.79 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
ctest_upload.html
6.7 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
define_property.html
15.53 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
else.html
5.35 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
elseif.html
5.44 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
enable_language.html
10.08 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
enable_testing.html
6.04 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endblock.html
5.66 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endforeach.html
5.88 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endfunction.html
5.85 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endif.html
5.71 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endmacro.html
5.79 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
endwhile.html
5.79 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
exec_program.html
7.52 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
execute_process.html
20.95 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
export.html
19.49 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
export_library_dependencies.html
8.01 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
file.html
128.25 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
find_file.html
39.65 KB
04/04/2023 07:05:00 PM
rw-r--r--
π
find_library.html
46.52 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
find_package.html
91.29 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
find_path.html
40.22 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
find_program.html
37.17 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
fltk_wrap_ui.html
5.8 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
foreach.html
18.65 KB
04/04/2023 07:05:01 PM
rw-r--r--
π
function.html
12.42 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_cmake_property.html
8.05 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_directory_property.html
9.08 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_filename_component.html
12.57 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_property.html
15.95 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_source_file_property.html
11.47 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_target_property.html
9.1 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
get_test_property.html
8.06 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
if.html
41.89 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
include.html
8.04 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
include_directories.html
10.54 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
include_external_msproject.html
8.14 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
include_guard.html
8.85 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
include_regular_expression.html
6.14 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
install.html
126.44 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
install_files.html
9.13 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
install_programs.html
9.09 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
install_targets.html
7 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
link_directories.html
11.99 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
link_libraries.html
7.36 KB
04/04/2023 07:05:02 PM
rw-r--r--
π
list.html
35.79 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
load_cache.html
6.78 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
load_command.html
6.61 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
macro.html
20.49 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
make_directory.html
5.77 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
mark_as_advanced.html
6.73 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
math.html
9.01 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
message.html
27.67 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
option.html
6.48 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
output_required_files.html
6.59 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
project.html
30.84 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
qt_wrap_cpp.html
7.2 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
qt_wrap_ui.html
7.43 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
remove.html
6 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
remove_definitions.html
6.15 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
return.html
16.06 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
separate_arguments.html
11.04 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set.html
18.35 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set_directory_properties.html
7.58 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set_property.html
17.74 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set_source_files_properties.html
10.63 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set_target_properties.html
8.33 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
set_tests_properties.html
7.98 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
site_name.html
5.46 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
source_group.html
10.97 KB
04/04/2023 07:05:03 PM
rw-r--r--
π
string.html
64.24 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
subdir_depends.html
5.69 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
subdirs.html
7.51 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_compile_definitions.html
16.09 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_compile_features.html
14.47 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_compile_options.html
18.02 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_include_directories.html
22.39 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_link_directories.html
16.03 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_link_libraries.html
60.83 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_link_options.html
23.66 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_precompile_headers.html
24.42 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
target_sources.html
38.35 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
try_compile.html
57.47 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
try_run.html
24.62 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
unset.html
9.21 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
use_mangled_mesa.html
5.91 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
utility_source.html
6.78 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
variable_requires.html
6.84 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
variable_watch.html
8.98 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
while.html
9.14 KB
04/04/2023 07:05:04 PM
rw-r--r--
π
write_file.html
7.25 KB
04/04/2023 07:05:04 PM
rw-r--r--
Editing: if.html
Close
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <title>if — CMake 3.26.3 Documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/cmake.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script> <script src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="include" href="include.html" /> <link rel="prev" title="get_property" href="get_property.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="include.html" title="include" accesskey="N">next</a> |</li> <li class="right" > <a href="get_property.html" title="get_property" accesskey="P">previous</a> |</li> <li> <img src="../_static/cmake-logo-16.png" alt="" style="vertical-align: middle; margin-top: -2px" /> </li> <li> <a href="https://cmake.org/">CMake</a> » </li> <li> <a href="../index.html">3.26.3 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" accesskey="U">cmake-commands(7)</a> »</li> <li class="nav-item nav-item-this"><a href="">if</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="if"> <span id="command:if"></span><h1>if<a class="headerlink" href="#if" title="Permalink to this heading">ΒΆ</a></h1> <p>Conditionally execute a group of commands.</p> <section id="synopsis"> <h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this heading">ΒΆ</a></h2> <div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">if(</span><span class="nv"><condition></span><span class="nf">)</span><span class="w"></span> <span class="w"> </span><span class="nv"><commands></span><span class="w"></span> <span class="nf">elseif(</span><span class="nv"><condition></span><span class="nf">)</span><span class="w"> </span><span class="c"># optional block, can be repeated</span> <span class="w"> </span><span class="nv"><commands></span><span class="w"></span> <span class="nf">else()</span><span class="w"> </span><span class="c"># optional block</span> <span class="w"> </span><span class="nv"><commands></span><span class="w"></span> <span class="nf">endif()</span><span class="w"></span> </pre></div> </div> <p>Evaluates the <code class="docutils literal notranslate"><span class="pre">condition</span></code> argument of the <code class="docutils literal notranslate"><span class="pre">if</span></code> clause according to the <a class="reference internal" href="#condition-syntax">Condition syntax</a> described below. If the result is true, then the <code class="docutils literal notranslate"><span class="pre">commands</span></code> in the <code class="docutils literal notranslate"><span class="pre">if</span></code> block are executed. Otherwise, optional <code class="docutils literal notranslate"><span class="pre">elseif</span></code> blocks are processed in the same way. Finally, if no <code class="docutils literal notranslate"><span class="pre">condition</span></code> is true, <code class="docutils literal notranslate"><span class="pre">commands</span></code> in the optional <code class="docutils literal notranslate"><span class="pre">else</span></code> block are executed.</p> <p>Per legacy, the <span class="target" id="index-0-command:else"></span><a class="reference internal" href="else.html#command:else" title="else"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">else()</span></code></a> and <span class="target" id="index-0-command:endif"></span><a class="reference internal" href="endif.html#command:endif" title="endif"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">endif()</span></code></a> commands admit an optional <code class="docutils literal notranslate"><span class="pre"><condition></span></code> argument. If used, it must be a verbatim repeat of the argument of the opening <code class="docutils literal notranslate"><span class="pre">if</span></code> command.</p> </section> <section id="condition-syntax"> <span id="id1"></span><h2>Condition Syntax<a class="headerlink" href="#condition-syntax" title="Permalink to this heading">ΒΆ</a></h2> <p>The following syntax applies to the <code class="docutils literal notranslate"><span class="pre">condition</span></code> argument of the <code class="docutils literal notranslate"><span class="pre">if</span></code>, <code class="docutils literal notranslate"><span class="pre">elseif</span></code> and <span class="target" id="index-0-command:while"></span><a class="reference internal" href="while.html#command:while" title="while"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">while()</span></code></a> clauses.</p> <p>Compound conditions are evaluated in the following order of precedence:</p> <ol class="arabic simple"> <li><p>Parentheses.</p></li> <li><p>Unary tests such as <a class="reference internal" href="#exists">EXISTS</a>, <a class="reference internal" href="#command">COMMAND</a>, and <a class="reference internal" href="#defined">DEFINED</a>.</p></li> <li><p>Binary tests such as <a class="reference internal" href="#equal">EQUAL</a>, <a class="reference internal" href="#less">LESS</a>, <a class="reference internal" href="#less-equal">LESS_EQUAL</a>, <a class="reference internal" href="#greater">GREATER</a>, <a class="reference internal" href="#greater-equal">GREATER_EQUAL</a>, <a class="reference internal" href="#strequal">STREQUAL</a>, <a class="reference internal" href="#strless">STRLESS</a>, <a class="reference internal" href="#strless-equal">STRLESS_EQUAL</a>, <a class="reference internal" href="#strgreater">STRGREATER</a>, <a class="reference internal" href="#strgreater-equal">STRGREATER_EQUAL</a>, <a class="reference internal" href="#version-equal">VERSION_EQUAL</a>, <a class="reference internal" href="#version-less">VERSION_LESS</a>, <a class="reference internal" href="#version-less-equal">VERSION_LESS_EQUAL</a>, <a class="reference internal" href="#version-greater">VERSION_GREATER</a>, <a class="reference internal" href="#version-greater-equal">VERSION_GREATER_EQUAL</a>, <a class="reference internal" href="#path-equal">PATH_EQUAL</a>, and <a class="reference internal" href="#matches">MATCHES</a>.</p></li> <li><p>Unary logical operator <a class="reference internal" href="#not">NOT</a>.</p></li> <li><p>Binary logical operators <a class="reference internal" href="#and">AND</a> and <a class="reference internal" href="#or">OR</a>, from left to right, without any short-circuit.</p></li> </ol> <section id="basic-expressions"> <h3>Basic Expressions<a class="headerlink" href="#basic-expressions" title="Permalink to this heading">ΒΆ</a></h3> <dl class="simple"> <dt><code class="docutils literal notranslate"><span class="pre">if(<constant>)</span></code></dt><dd><p>True if the constant is <code class="docutils literal notranslate"><span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">ON</span></code>, <code class="docutils literal notranslate"><span class="pre">YES</span></code>, <code class="docutils literal notranslate"><span class="pre">TRUE</span></code>, <code class="docutils literal notranslate"><span class="pre">Y</span></code>, or a non-zero number (including floating point numbers). False if the constant is <code class="docutils literal notranslate"><span class="pre">0</span></code>, <code class="docutils literal notranslate"><span class="pre">OFF</span></code>, <code class="docutils literal notranslate"><span class="pre">NO</span></code>, <code class="docutils literal notranslate"><span class="pre">FALSE</span></code>, <code class="docutils literal notranslate"><span class="pre">N</span></code>, <code class="docutils literal notranslate"><span class="pre">IGNORE</span></code>, <code class="docutils literal notranslate"><span class="pre">NOTFOUND</span></code>, the empty string, or ends in the suffix <code class="docutils literal notranslate"><span class="pre">-NOTFOUND</span></code>. Named boolean constants are case-insensitive. If the argument is not one of these specific constants, it is treated as a variable or string (see <a class="reference internal" href="#variable-expansion">Variable Expansion</a> further below) and one of the following two forms applies.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable>)</span></code></dt><dd><p>True if given a variable that is defined to a value that is not a false constant. False otherwise, including if the variable is undefined. Note that macro arguments are not variables. <a class="reference internal" href="../manual/cmake-language.7.html#cmake-language-environment-variables"><span class="std std-ref">Environment Variables</span></a> also cannot be tested this way, e.g. <code class="docutils literal notranslate"><span class="pre">if(ENV{some_var})</span></code> will always evaluate to false.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(<string>)</span></code></dt><dd><p>A quoted string always evaluates to false unless:</p> <ul class="simple"> <li><p>The string's value is one of the true constants, or</p></li> <li><p>Policy <span class="target" id="index-0-policy:CMP0054"></span><a class="reference internal" href="../policy/CMP0054.html#policy:CMP0054" title="CMP0054"><code class="xref cmake cmake-policy docutils literal notranslate"><span class="pre">CMP0054</span></code></a> is not set to <code class="docutils literal notranslate"><span class="pre">NEW</span></code> and the string's value happens to be a variable name that is affected by <span class="target" id="index-1-policy:CMP0054"></span><a class="reference internal" href="../policy/CMP0054.html#policy:CMP0054" title="CMP0054"><code class="xref cmake cmake-policy docutils literal notranslate"><span class="pre">CMP0054</span></code></a>'s behavior.</p></li> </ul> </dd> </dl> </section> <section id="logic-operators"> <h3>Logic Operators<a class="headerlink" href="#logic-operators" title="Permalink to this heading">ΒΆ</a></h3> <dl class="simple" id="not"> <dt><code class="docutils literal notranslate"><span class="pre">if(NOT</span> <span class="pre"><condition>)</span></code></dt><dd><p>True if the condition is not true.</p> </dd> </dl> <dl class="simple" id="and"> <dt><code class="docutils literal notranslate"><span class="pre">if(<cond1></span> <span class="pre">AND</span> <span class="pre"><cond2>)</span></code></dt><dd><p>True if both conditions would be considered true individually.</p> </dd> </dl> <dl class="simple" id="or"> <dt><code class="docutils literal notranslate"><span class="pre">if(<cond1></span> <span class="pre">OR</span> <span class="pre"><cond2>)</span></code></dt><dd><p>True if either condition would be considered true individually.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if((condition)</span> <span class="pre">AND</span> <span class="pre">(condition</span> <span class="pre">OR</span> <span class="pre">(condition)))</span></code></dt><dd><p>The conditions inside the parenthesis are evaluated first and then the remaining condition is evaluated as in the other examples. Where there are nested parenthesis the innermost are evaluated as part of evaluating the condition that contains them.</p> </dd> </dl> </section> <section id="existence-checks"> <h3>Existence Checks<a class="headerlink" href="#existence-checks" title="Permalink to this heading">ΒΆ</a></h3> <dl id="command"> <dt><code class="docutils literal notranslate"><span class="pre">if(COMMAND</span> <span class="pre">command-name)</span></code></dt><dd><p>True if the given name is a command, macro or function that can be invoked.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(POLICY</span> <span class="pre">policy-id)</span></code></dt><dd><p>True if the given name is an existing policy (of the form <code class="docutils literal notranslate"><span class="pre">CMP<NNNN></span></code>).</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(TARGET</span> <span class="pre">target-name)</span></code></dt><dd><p>True if the given name is an existing logical target name created by a call to the <span class="target" id="index-0-command:add_executable"></span><a class="reference internal" href="add_executable.html#command:add_executable" title="add_executable"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">add_executable()</span></code></a>, <span class="target" id="index-0-command:add_library"></span><a class="reference internal" href="add_library.html#command:add_library" title="add_library"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">add_library()</span></code></a>, or <span class="target" id="index-0-command:add_custom_target"></span><a class="reference internal" href="add_custom_target.html#command:add_custom_target" title="add_custom_target"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">add_custom_target()</span></code></a> command that has already been invoked (in any directory).</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(TEST</span> <span class="pre">test-name)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.3: </span>True if the given name is an existing test name created by the <span class="target" id="index-0-command:add_test"></span><a class="reference internal" href="add_test.html#command:add_test" title="add_test"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">add_test()</span></code></a> command.</p> </div> </dd> </dl> <dl id="defined"> <dt><code class="docutils literal notranslate"><span class="pre">if(DEFINED</span> <span class="pre"><name>|CACHE{<name>}|ENV{<name>})</span></code></dt><dd><p>True if a variable, cache variable or environment variable with given <code class="docutils literal notranslate"><span class="pre"><name></span></code> is defined. The value of the variable does not matter. Note the following caveats:</p> <ul class="simple"> <li><p>Macro arguments are not variables.</p></li> <li><p>It is not possible to test directly whether a <cite><name></cite> is a non-cache variable. The expression <code class="docutils literal notranslate"><span class="pre">if(DEFINED</span> <span class="pre">someName)</span></code> will evaluate to true if either a cache or non-cache variable <code class="docutils literal notranslate"><span class="pre">someName</span></code> exists. In comparison, the expression <code class="docutils literal notranslate"><span class="pre">if(DEFINED</span> <span class="pre">CACHE{someName})</span></code> will only evaluate to true if a cache variable <code class="docutils literal notranslate"><span class="pre">someName</span></code> exists. Both expressions need to be tested if you need to know whether a non-cache variable exists: <code class="docutils literal notranslate"><span class="pre">if(DEFINED</span> <span class="pre">someName</span> <span class="pre">AND</span> <span class="pre">NOT</span> <span class="pre">DEFINED</span> <span class="pre">CACHE{someName})</span></code>.</p></li> </ul> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.14: </span>Added support for <code class="docutils literal notranslate"><span class="pre">CACHE{<name>}</span></code> variables.</p> </div> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">IN_LIST</span> <span class="pre"><variable>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.3: </span>True if the given element is contained in the named list variable.</p> </div> </dd> </dl> </section> <section id="file-operations"> <h3>File Operations<a class="headerlink" href="#file-operations" title="Permalink to this heading">ΒΆ</a></h3> <dl id="exists"> <dt><code class="docutils literal notranslate"><span class="pre">if(EXISTS</span> <span class="pre">path-to-file-or-directory)</span></code></dt><dd><p>True if the named file or directory exists. Behavior is well-defined only for explicit full paths (a leading <code class="docutils literal notranslate"><span class="pre">~/</span></code> is not expanded as a home directory and is considered a relative path). Resolves symbolic links, i.e. if the named file or directory is a symbolic link, returns true if the target of the symbolic link exists.</p> <p>False if the given path is an empty string.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(file1</span> <span class="pre">IS_NEWER_THAN</span> <span class="pre">file2)</span></code></dt><dd><p>True if <code class="docutils literal notranslate"><span class="pre">file1</span></code> is newer than <code class="docutils literal notranslate"><span class="pre">file2</span></code> 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 <code class="docutils literal notranslate"><span class="pre">IS_NEWER_THAN</span></code> 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.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(IS_DIRECTORY</span> <span class="pre">path)</span></code></dt><dd><p>True if <code class="docutils literal notranslate"><span class="pre">path</span></code> is a directory. Behavior is well-defined only for full paths.</p> <p>False if the given path is an empty string.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(IS_SYMLINK</span> <span class="pre">file-name)</span></code></dt><dd><p>True if the given name is a symbolic link. Behavior is well-defined only for full paths.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">if(IS_ABSOLUTE</span> <span class="pre">path)</span></code></dt><dd><p>True if the given path is an absolute path. Note the following special cases:</p> <ul class="simple"> <li><p>An empty <code class="docutils literal notranslate"><span class="pre">path</span></code> evaluates to false.</p></li> <li><p>On Windows hosts, any <code class="docutils literal notranslate"><span class="pre">path</span></code> that begins with a drive letter and colon (e.g. <code class="docutils literal notranslate"><span class="pre">C:</span></code>), a forward slash or a backslash will evaluate to true. This means a path like <code class="docutils literal notranslate"><span class="pre">C:no\base\dir</span></code> will evaluate to true, even though the non-drive part of the path is relative.</p></li> <li><p>On non-Windows hosts, any <code class="docutils literal notranslate"><span class="pre">path</span></code> that begins with a tilde (<code class="docutils literal notranslate"><span class="pre">~</span></code>) evaluates to true.</p></li> </ul> </dd> </dl> </section> <section id="comparisons"> <h3>Comparisons<a class="headerlink" href="#comparisons" title="Permalink to this heading">ΒΆ</a></h3> <dl id="matches"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">MATCHES</span> <span class="pre">regex)</span></code></dt><dd><p>True if the given string or variable's value matches the given regular expression. See <a class="reference internal" href="string.html#regex-specification"><span class="std std-ref">Regex Specification</span></a> for regex format.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9: </span><code class="docutils literal notranslate"><span class="pre">()</span></code> groups are captured in <span class="target" id="index-0-variable:CMAKE_MATCH_<n>"></span><a class="reference internal" href="../variable/CMAKE_MATCH_n.html#variable:CMAKE_MATCH_<n>" title="CMAKE_MATCH_<n>"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_MATCH_<n></span></code></a> variables.</p> </div> </dd> </dl> <dl class="simple" id="less"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">LESS</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is a valid number and less than that on the right.</p> </dd> </dl> <dl class="simple" id="greater"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">GREATER</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is a valid number and greater than that on the right.</p> </dd> </dl> <dl class="simple" id="equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is a valid number and equal to that on the right.</p> </dd> </dl> <dl id="less-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">LESS_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>True if the given string or variable's value is a valid number and less than or equal to that on the right.</p> </div> </dd> </dl> <dl id="greater-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">GREATER_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>True if the given string or variable's value is a valid number and greater than or equal to that on the right.</p> </div> </dd> </dl> <dl class="simple" id="strless"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">STRLESS</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is lexicographically less than the string or variable on the right.</p> </dd> </dl> <dl class="simple" id="strgreater"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">STRGREATER</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is lexicographically greater than the string or variable on the right.</p> </dd> </dl> <dl class="simple" id="strequal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">STREQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>True if the given string or variable's value is lexicographically equal to the string or variable on the right.</p> </dd> </dl> <dl id="strless-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">STRLESS_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>True if the given string or variable's value is lexicographically less than or equal to the string or variable on the right.</p> </div> </dd> </dl> <dl id="strgreater-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">STRGREATER_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>True if the given string or variable's value is lexicographically greater than or equal to the string or variable on the right.</p> </div> </dd> </dl> </section> <section id="version-comparisons"> <h3>Version Comparisons<a class="headerlink" href="#version-comparisons" title="Permalink to this heading">ΒΆ</a></h3> <dl class="simple" id="version-less"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">VERSION_LESS</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>Component-wise integer version number comparison (version format is <code class="docutils literal notranslate"><span class="pre">major[.minor[.patch[.tweak]]]</span></code>, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point.</p> </dd> </dl> <dl class="simple" id="version-greater"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">VERSION_GREATER</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>Component-wise integer version number comparison (version format is <code class="docutils literal notranslate"><span class="pre">major[.minor[.patch[.tweak]]]</span></code>, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point.</p> </dd> </dl> <dl class="simple" id="version-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">VERSION_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><p>Component-wise integer version number comparison (version format is <code class="docutils literal notranslate"><span class="pre">major[.minor[.patch[.tweak]]]</span></code>, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point.</p> </dd> </dl> <dl id="version-less-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">VERSION_LESS_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>Component-wise integer version number comparison (version format is <code class="docutils literal notranslate"><span class="pre">major[.minor[.patch[.tweak]]]</span></code>, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point.</p> </div> </dd> </dl> <dl id="version-greater-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">VERSION_GREATER_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>Component-wise integer version number comparison (version format is <code class="docutils literal notranslate"><span class="pre">major[.minor[.patch[.tweak]]]</span></code>, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point.</p> </div> </dd> </dl> </section> <section id="path-comparisons"> <h3>Path Comparisons<a class="headerlink" href="#path-comparisons" title="Permalink to this heading">ΒΆ</a></h3> <dl id="path-equal"> <dt><code class="docutils literal notranslate"><span class="pre">if(<variable|string></span> <span class="pre">PATH_EQUAL</span> <span class="pre"><variable|string>)</span></code></dt><dd><div class="versionadded"> <p><span class="versionmodified added">New in version 3.24.</span></p> </div> <p>Compares the two paths component-by-component. Only if every component of both paths match will the two paths compare equal. Multiple path separators are effectively collapsed into a single separator, but note that backslashes are not converted to forward slashes. No other <a class="reference internal" href="cmake_path.html#normalization"><span class="std std-ref">path normalization</span></a> is performed.</p> <p>Component-wise comparison is superior to string-based comparison due to the handling of multiple path separators. In the following example, the expression evaluates to true using <code class="docutils literal notranslate"><span class="pre">PATH_EQUAL</span></code>, but false with <code class="docutils literal notranslate"><span class="pre">STREQUAL</span></code>:</p> <div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="c"># comparison is TRUE</span> <span class="nf">if</span> <span class="nf">(</span><span class="s">"/a//b/c"</span><span class="w"> </span><span class="no">PATH_EQUAL</span><span class="w"> </span><span class="s">"/a/b/c"</span><span class="nf">)</span><span class="w"></span> <span class="w"> </span><span class="p">...</span><span class="w"></span> <span class="nf">endif()</span><span class="w"></span> <span class="c"># comparison is FALSE</span> <span class="nf">if</span> <span class="nf">(</span><span class="s">"/a//b/c"</span><span class="w"> </span><span class="no">STREQUAL</span><span class="w"> </span><span class="s">"/a/b/c"</span><span class="nf">)</span><span class="w"></span> <span class="w"> </span><span class="p">...</span><span class="w"></span> <span class="nf">endif()</span><span class="w"></span> </pre></div> </div> <p>See <a class="reference internal" href="cmake_path.html#path-compare"><span class="std std-ref">cmake_path(COMPARE)</span></a> for more details.</p> </dd> </dl> </section> </section> <section id="variable-expansion"> <h2>Variable Expansion<a class="headerlink" href="#variable-expansion" title="Permalink to this heading">ΒΆ</a></h2> <p>The if command was written very early in CMake's history, predating the <code class="docutils literal notranslate"><span class="pre">${}</span></code> variable evaluation syntax, and for convenience evaluates variables named by its arguments as shown in the above signatures. Note that normal variable evaluation with <code class="docutils literal notranslate"><span class="pre">${}</span></code> applies before the if command even receives the arguments. Therefore code like</p> <div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set(</span><span class="nb">var1</span><span class="w"> </span><span class="no">OFF</span><span class="nf">)</span><span class="w"></span> <span class="nf">set(</span><span class="nb">var2</span><span class="w"> </span><span class="s">"var1"</span><span class="nf">)</span><span class="w"></span> <span class="nf">if(</span><span class="o">${</span><span class="nt">var2</span><span class="o">}</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>appears to the if command as</p> <div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">if(</span><span class="nb">var1</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>and is evaluated according to the <code class="docutils literal notranslate"><span class="pre">if(<variable>)</span></code> case documented above. The result is <code class="docutils literal notranslate"><span class="pre">OFF</span></code> which is false. However, if we remove the <code class="docutils literal notranslate"><span class="pre">${}</span></code> from the example then the command sees</p> <div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">if(</span><span class="nb">var2</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>which is true because <code class="docutils literal notranslate"><span class="pre">var2</span></code> is defined to <code class="docutils literal notranslate"><span class="pre">var1</span></code> which is not a false constant.</p> <p>Automatic evaluation applies in the other cases whenever the above-documented condition syntax accepts <code class="docutils literal notranslate"><span class="pre"><variable|string></span></code>:</p> <ul class="simple"> <li><p>The left hand argument to <code class="docutils literal notranslate"><span class="pre">MATCHES</span></code> is first checked to see if it is a defined variable, if so the variable's value is used, otherwise the original value is used.</p></li> <li><p>If the left hand argument to <code class="docutils literal notranslate"><span class="pre">MATCHES</span></code> is missing it returns false without error</p></li> <li><p>Both left and right hand arguments to <code class="docutils literal notranslate"><span class="pre">LESS</span></code>, <code class="docutils literal notranslate"><span class="pre">GREATER</span></code>, <code class="docutils literal notranslate"><span class="pre">EQUAL</span></code>, <code class="docutils literal notranslate"><span class="pre">LESS_EQUAL</span></code>, and <code class="docutils literal notranslate"><span class="pre">GREATER_EQUAL</span></code>, are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.</p></li> <li><p>Both left and right hand arguments to <code class="docutils literal notranslate"><span class="pre">STRLESS</span></code>, <code class="docutils literal notranslate"><span class="pre">STRGREATER</span></code>, <code class="docutils literal notranslate"><span class="pre">STREQUAL</span></code>, <code class="docutils literal notranslate"><span class="pre">STRLESS_EQUAL</span></code>, and <code class="docutils literal notranslate"><span class="pre">STRGREATER_EQUAL</span></code> are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.</p></li> <li><p>Both left and right hand arguments to <code class="docutils literal notranslate"><span class="pre">VERSION_LESS</span></code>, <code class="docutils literal notranslate"><span class="pre">VERSION_GREATER</span></code>, <code class="docutils literal notranslate"><span class="pre">VERSION_EQUAL</span></code>, <code class="docutils literal notranslate"><span class="pre">VERSION_LESS_EQUAL</span></code>, and <code class="docutils literal notranslate"><span class="pre">VERSION_GREATER_EQUAL</span></code> are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.</p></li> <li><p>The right hand argument to <code class="docutils literal notranslate"><span class="pre">NOT</span></code> is tested to see if it is a boolean constant, if so the value is used, otherwise it is assumed to be a variable and it is dereferenced.</p></li> <li><p>The left and right hand arguments to <code class="docutils literal notranslate"><span class="pre">AND</span></code> and <code class="docutils literal notranslate"><span class="pre">OR</span></code> are independently tested to see if they are boolean constants, if so they are used as such, otherwise they are assumed to be variables and are dereferenced.</p></li> </ul> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.1: </span>To prevent ambiguity, potential variable or keyword names can be specified in a <a class="reference internal" href="../manual/cmake-language.7.html#quoted-argument"><span class="std std-ref">Quoted Argument</span></a> or a <a class="reference internal" href="../manual/cmake-language.7.html#bracket-argument"><span class="std std-ref">Bracket Argument</span></a>. A quoted or bracketed variable or keyword will be interpreted as a string and not dereferenced or interpreted. See policy <span class="target" id="index-2-policy:CMP0054"></span><a class="reference internal" href="../policy/CMP0054.html#policy:CMP0054" title="CMP0054"><code class="xref cmake cmake-policy docutils literal notranslate"><span class="pre">CMP0054</span></code></a>.</p> </div> <p>There is no automatic evaluation for environment or cache <a class="reference internal" href="../manual/cmake-language.7.html#variable-references"><span class="std std-ref">Variable References</span></a>. Their values must be referenced as <code class="docutils literal notranslate"><span class="pre">$ENV{<name>}</span></code> or <code class="docutils literal notranslate"><span class="pre">$CACHE{<name>}</span></code> wherever the above-documented condition syntax accepts <code class="docutils literal notranslate"><span class="pre"><variable|string></span></code>.</p> </section> <section id="see-also"> <h2>See also<a class="headerlink" href="#see-also" title="Permalink to this heading">ΒΆ</a></h2> <ul class="simple"> <li><p><span class="target" id="index-1-command:else"></span><a class="reference internal" href="else.html#command:else" title="else"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">else()</span></code></a></p></li> <li><p><span class="target" id="index-0-command:elseif"></span><a class="reference internal" href="elseif.html#command:elseif" title="elseif"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">elseif()</span></code></a></p></li> <li><p><span class="target" id="index-1-command:endif"></span><a class="reference internal" href="endif.html#command:endif" title="endif"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">endif()</span></code></a></p></li> </ul> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">if</a><ul> <li><a class="reference internal" href="#synopsis">Synopsis</a></li> <li><a class="reference internal" href="#condition-syntax">Condition Syntax</a><ul> <li><a class="reference internal" href="#basic-expressions">Basic Expressions</a></li> <li><a class="reference internal" href="#logic-operators">Logic Operators</a></li> <li><a class="reference internal" href="#existence-checks">Existence Checks</a></li> <li><a class="reference internal" href="#file-operations">File Operations</a></li> <li><a class="reference internal" href="#comparisons">Comparisons</a></li> <li><a class="reference internal" href="#version-comparisons">Version Comparisons</a></li> <li><a class="reference internal" href="#path-comparisons">Path Comparisons</a></li> </ul> </li> <li><a class="reference internal" href="#variable-expansion">Variable Expansion</a></li> <li><a class="reference internal" href="#see-also">See also</a></li> </ul> </li> </ul> </div> <div> <h4>Previous topic</h4> <p class="topless"><a href="get_property.html" title="previous chapter">get_property</a></p> </div> <div> <h4>Next topic</h4> <p class="topless"><a href="include.html" title="next chapter">include</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/command/if.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>document.getElementById('searchbox').style.display = "block"</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="include.html" title="include" >next</a> |</li> <li class="right" > <a href="get_property.html" title="get_property" >previous</a> |</li> <li> <img src="../_static/cmake-logo-16.png" alt="" style="vertical-align: middle; margin-top: -2px" /> </li> <li> <a href="https://cmake.org/">CMake</a> » </li> <li> <a href="../index.html">3.26.3 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" >cmake-commands(7)</a> »</li> <li class="nav-item nav-item-this"><a href="">if</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2000-2023 Kitware, Inc. and Contributors. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.0.2. </div> </body> </html>