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: list.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>list — 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="macro" href="macro.html" /> <link rel="prev" title="include_guard" href="include_guard.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="macro.html" title="macro" accesskey="N">next</a> |</li> <li class="right" > <a href="include_guard.html" title="include_guard" 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="">list</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="list"> <span id="command:list"></span><h1>list<a class="headerlink" href="#list" title="Permalink to this heading">ΒΆ</a></h1> <p>List operations.</p> <section id="synopsis"> <h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this heading">ΒΆ</a></h2> <pre class="literal-block"><a class="reference internal" href="#reading">Reading</a> list(<a class="reference internal" href="#length">LENGTH</a> <list> <out-var>) list(<a class="reference internal" href="#get">GET</a> <list> <element index> [<index> ...] <out-var>) list(<a class="reference internal" href="#join">JOIN</a> <list> <glue> <out-var>) list(<a class="reference internal" href="#sublist">SUBLIST</a> <list> <begin> <length> <out-var>) <a class="reference internal" href="#search">Search</a> list(<a class="reference internal" href="#find">FIND</a> <list> <value> <out-var>) <a class="reference internal" href="#modification">Modification</a> list(<a class="reference internal" href="#append">APPEND</a> <list> [<element>...]) list(<a class="reference internal" href="#filter">FILTER</a> <list> {INCLUDE | EXCLUDE} REGEX <regex>) list(<a class="reference internal" href="#insert">INSERT</a> <list> <index> [<element>...]) list(<a class="reference internal" href="#pop-back">POP_BACK</a> <list> [<out-var>...]) list(<a class="reference internal" href="#pop-front">POP_FRONT</a> <list> [<out-var>...]) list(<a class="reference internal" href="#prepend">PREPEND</a> <list> [<element>...]) list(<a class="reference internal" href="#remove-item">REMOVE_ITEM</a> <list> <value>...) list(<a class="reference internal" href="#remove-at">REMOVE_AT</a> <list> <index>...) list(<a class="reference internal" href="#remove-duplicates">REMOVE_DUPLICATES</a> <list>) list(<a class="reference internal" href="#transform">TRANSFORM</a> <list> <ACTION> [...]) <a class="reference internal" href="#ordering">Ordering</a> list(<a class="reference internal" href="#reverse">REVERSE</a> <list>) list(<a class="reference internal" href="#sort">SORT</a> <list> [...])</pre> </section> <section id="introduction"> <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this heading">ΒΆ</a></h2> <p>The list subcommands <code class="docutils literal notranslate"><span class="pre">APPEND</span></code>, <code class="docutils literal notranslate"><span class="pre">INSERT</span></code>, <code class="docutils literal notranslate"><span class="pre">FILTER</span></code>, <code class="docutils literal notranslate"><span class="pre">PREPEND</span></code>, <code class="docutils literal notranslate"><span class="pre">POP_BACK</span></code>, <code class="docutils literal notranslate"><span class="pre">POP_FRONT</span></code>, <code class="docutils literal notranslate"><span class="pre">REMOVE_AT</span></code>, <code class="docutils literal notranslate"><span class="pre">REMOVE_ITEM</span></code>, <code class="docutils literal notranslate"><span class="pre">REMOVE_DUPLICATES</span></code>, <code class="docutils literal notranslate"><span class="pre">REVERSE</span></code> and <code class="docutils literal notranslate"><span class="pre">SORT</span></code> may create new values for the list within the current CMake variable scope. Similar to the <span class="target" id="index-0-command:set"></span><a class="reference internal" href="set.html#command:set" title="set"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">set()</span></code></a> command, the LIST command creates new variable values in the current scope, even if the list itself is actually defined in a parent scope. To propagate the results of these operations upwards, use <span class="target" id="index-1-command:set"></span><a class="reference internal" href="set.html#command:set" title="set"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">set()</span></code></a> with <code class="docutils literal notranslate"><span class="pre">PARENT_SCOPE</span></code>, <span class="target" id="index-2-command:set"></span><a class="reference internal" href="set.html#command:set" title="set"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">set()</span></code></a> with <code class="docutils literal notranslate"><span class="pre">CACHE</span> <span class="pre">INTERNAL</span></code>, or some other means of value propagation.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>A list in cmake is a <code class="docutils literal notranslate"><span class="pre">;</span></code> separated group of strings. To create a list the set command can be used. For example, <code class="docutils literal notranslate"><span class="pre">set(var</span> <span class="pre">a</span> <span class="pre">b</span> <span class="pre">c</span> <span class="pre">d</span> <span class="pre">e)</span></code> creates a list with <code class="docutils literal notranslate"><span class="pre">a;b;c;d;e</span></code>, and <code class="docutils literal notranslate"><span class="pre">set(var</span> <span class="pre">"a</span> <span class="pre">b</span> <span class="pre">c</span> <span class="pre">d</span> <span class="pre">e")</span></code> creates a string or a list with one item in it. (Note macro arguments are not variables, and therefore cannot be used in LIST commands.)</p> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>When specifying index values, if <code class="docutils literal notranslate"><span class="pre"><element</span> <span class="pre">index></span></code> is 0 or greater, it is indexed from the beginning of the list, with 0 representing the first list element. If <code class="docutils literal notranslate"><span class="pre"><element</span> <span class="pre">index></span></code> is -1 or lesser, it is indexed from the end of the list, with -1 representing the last list element. Be careful when counting with negative indices: they do not start from 0. -0 is equivalent to 0, the first list element.</p> </div> </section> <section id="reading"> <h2>Reading<a class="headerlink" href="#reading" title="Permalink to this heading">ΒΆ</a></h2> <div class="highlight-cmake notranslate" id="length"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">LENGTH</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><output variable></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Returns the list's length.</p> <div class="highlight-cmake notranslate" id="get"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">GET</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><element index></span><span class="w"> </span><span class="p">[</span><span class="nv"><element index></span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="nv"><output variable></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Returns the list of elements specified by indices from the list.</p> <div class="highlight-cmake notranslate" id="join"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">JOIN</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><glue></span><span class="w"> </span><span class="nv"><output variable></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> <p>Returns a string joining all list's elements using the glue string. To join multiple strings, which are not part of a list, use <code class="docutils literal notranslate"><span class="pre">JOIN</span></code> operator from <span class="target" id="index-0-command:string"></span><a class="reference internal" href="string.html#command:string" title="string"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">string()</span></code></a> command.</p> <div class="highlight-cmake notranslate" id="sublist"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">SUBLIST</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><begin></span><span class="w"> </span><span class="nv"><length></span><span class="w"> </span><span class="nv"><output variable></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> <p>Returns a sublist of the given list. If <code class="docutils literal notranslate"><span class="pre"><length></span></code> is 0, an empty list will be returned. If <code class="docutils literal notranslate"><span class="pre"><length></span></code> is -1 or the list is smaller than <code class="docutils literal notranslate"><span class="pre"><begin>+<length></span></code> then the remaining elements of the list starting at <code class="docutils literal notranslate"><span class="pre"><begin></span></code> will be returned.</p> </section> <section id="search"> <h2>Search<a class="headerlink" href="#search" title="Permalink to this heading">ΒΆ</a></h2> <div class="highlight-cmake notranslate" id="find"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">FIND</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><value></span><span class="w"> </span><span class="nv"><output variable></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Returns the index of the element specified in the list or -1 if it wasn't found.</p> </section> <section id="modification"> <h2>Modification<a class="headerlink" href="#modification" title="Permalink to this heading">ΒΆ</a></h2> <div class="highlight-cmake notranslate" id="append"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">APPEND</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="p">[</span><span class="nv"><element></span><span class="w"> </span><span class="p">...]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Appends elements to the list. If no variable named <code class="docutils literal notranslate"><span class="pre"><list></span></code> exists in the current scope its value is treated as empty and the elements are appended to that empty list.</p> <div class="highlight-cmake notranslate" id="filter"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">FILTER</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="o"><</span><span class="no">INCLUDE</span><span class="p">|</span><span class="no">EXCLUDE</span><span class="o">></span><span class="w"> </span><span class="no">REGEX</span><span class="w"> </span><span class="nv"><regular_expression></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> <p>Includes or removes items from the list that match the mode's pattern. In <code class="docutils literal notranslate"><span class="pre">REGEX</span></code> mode, items will be matched against the given regular expression.</p> <p>For more information on regular expressions look under <a class="reference internal" href="string.html#regex-specification"><span class="std std-ref">string(REGEX)</span></a>.</p> <div class="highlight-cmake notranslate" id="insert"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">INSERT</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><element_index></span><span class="w"> </span><span class="nv"><element></span><span class="w"> </span><span class="p">[</span><span class="nv"><element></span><span class="w"> </span><span class="p">...]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Inserts elements to the list to the specified index. It is an error to specify an out-of-range index. Valid indexes are 0 to <cite>N</cite> where <cite>N</cite> is the length of the list, inclusive. An empty list has length 0. If no variable named <code class="docutils literal notranslate"><span class="pre"><list></span></code> exists in the current scope its value is treated as empty and the elements are inserted in that empty list.</p> <div class="highlight-cmake notranslate" id="pop-back"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">POP_BACK</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="p">[</span><span class="nv"><out-var>...</span><span class="p">]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.15.</span></p> </div> <p>If no variable name is given, removes exactly one element. Otherwise, with <cite>N</cite> variable names provided, assign the last <cite>N</cite> elements' values to the given variables and then remove the last <cite>N</cite> values from <code class="docutils literal notranslate"><span class="pre"><list></span></code>.</p> <div class="highlight-cmake notranslate" id="pop-front"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">POP_FRONT</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="p">[</span><span class="nv"><out-var>...</span><span class="p">]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.15.</span></p> </div> <p>If no variable name is given, removes exactly one element. Otherwise, with <cite>N</cite> variable names provided, assign the first <cite>N</cite> elements' values to the given variables and then remove the first <cite>N</cite> values from <code class="docutils literal notranslate"><span class="pre"><list></span></code>.</p> <div class="highlight-cmake notranslate" id="prepend"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">PREPEND</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="p">[</span><span class="nv"><element></span><span class="w"> </span><span class="p">...]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.15.</span></p> </div> <p>Insert elements to the 0th position in the list. If no variable named <code class="docutils literal notranslate"><span class="pre"><list></span></code> exists in the current scope its value is treated as empty and the elements are prepended to that empty list.</p> <div class="highlight-cmake notranslate" id="remove-item"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">REMOVE_ITEM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><value></span><span class="w"> </span><span class="p">[</span><span class="nv"><value></span><span class="w"> </span><span class="p">...]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Removes all instances of the given items from the list.</p> <div class="highlight-cmake notranslate" id="remove-at"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">REMOVE_AT</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><index></span><span class="w"> </span><span class="p">[</span><span class="nv"><index></span><span class="w"> </span><span class="p">...]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Removes items at given indices from the list.</p> <div class="highlight-cmake notranslate" id="remove-duplicates"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">REMOVE_DUPLICATES</span><span class="w"> </span><span class="nv"><list></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Removes duplicated items in the list. The relative order of items is preserved, but if duplicates are encountered, only the first instance is preserved.</p> <div class="highlight-cmake notranslate" id="transform"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><ACTION></span><span class="w"> </span><span class="p">[</span><span class="nv"><SELECTOR></span><span class="p">]</span><span class="w"></span> <span class="w"> </span><span class="p">[</span><span class="no">OUTPUT_VARIABLE</span><span class="w"> </span><span class="nv"><output variable></span><span class="p">]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> <p>Transforms the list by applying an action to all or, by specifying a <code class="docutils literal notranslate"><span class="pre"><SELECTOR></span></code>, to the selected elements of the list, storing the result in-place or in the specified output variable.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>The <code class="docutils literal notranslate"><span class="pre">TRANSFORM</span></code> sub-command does not change the number of elements in the list. If a <code class="docutils literal notranslate"><span class="pre"><SELECTOR></span></code> is specified, only some elements will be changed, the other ones will remain the same as before the transformation.</p> </div> <p><code class="docutils literal notranslate"><span class="pre"><ACTION></span></code> specifies the action to apply to the elements of the list. The actions have exactly the same semantics as sub-commands of the <span class="target" id="index-1-command:string"></span><a class="reference internal" href="string.html#command:string" title="string"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">string()</span></code></a> command. <code class="docutils literal notranslate"><span class="pre"><ACTION></span></code> must be one of the following:</p> <p><code class="docutils literal notranslate"><span class="pre">APPEND</span></code>, <code class="docutils literal notranslate"><span class="pre">PREPEND</span></code>: Append, prepend specified value to each element of the list.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="o"><</span><span class="no">APPEND</span><span class="p">|</span><span class="no">PREPEND</span><span class="o">></span><span class="w"> </span><span class="nv"><value></span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">TOUPPER</span></code>, <code class="docutils literal notranslate"><span class="pre">TOLOWER</span></code>: Convert each element of the list to upper, lower characters.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="o"><</span><span class="no">TOLOWER</span><span class="p">|</span><span class="no">TOUPPER</span><span class="o">></span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">STRIP</span></code>: Remove leading and trailing spaces from each element of the list.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="no">STRIP</span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">GENEX_STRIP</span></code>: Strip any <span class="target" id="index-0-manual:cmake-generator-expressions(7)"></span><a class="reference internal" href="../manual/cmake-generator-expressions.7.html#manual:cmake-generator-expressions(7)" title="cmake-generator-expressions(7)"><code class="xref cmake cmake-manual docutils literal notranslate"><span class="pre">generator</span> <span class="pre">expressions</span></code></a> from each element of the list.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="no">GENEX_STRIP</span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">REPLACE</span></code>: Match the regular expression as many times as possible and substitute the replacement expression for the match for each element of the list (Same semantic as <code class="docutils literal notranslate"><span class="pre">REGEX</span> <span class="pre">REPLACE</span></code> from <span class="target" id="index-2-command:string"></span><a class="reference internal" href="string.html#command:string" title="string"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">string()</span></code></a> command).</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="no">REPLACE</span><span class="w"> </span><span class="nv"><regular_expression></span><span class="w"></span> <span class="w"> </span><span class="nv"><replace_expression></span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre"><SELECTOR></span></code> determines which elements of the list will be transformed. Only one type of selector can be specified at a time. When given, <code class="docutils literal notranslate"><span class="pre"><SELECTOR></span></code> must be one of the following:</p> <p><code class="docutils literal notranslate"><span class="pre">AT</span></code>: Specify a list of indexes.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><ACTION></span><span class="w"> </span><span class="no">AT</span><span class="w"> </span><span class="nv"><index></span><span class="w"> </span><span class="p">[</span><span class="nv"><index></span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">FOR</span></code>: Specify a range with, optionally, an increment used to iterate over the range.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><ACTION></span><span class="w"> </span><span class="no">FOR</span><span class="w"> </span><span class="nv"><start></span><span class="w"> </span><span class="nv"><stop></span><span class="w"> </span><span class="p">[</span><span class="nv"><step></span><span class="p">]</span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">REGEX</span></code>: Specify a regular expression. Only elements matching the regular expression will be transformed.</p> <blockquote> <div><div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">TRANSFORM</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="nv"><ACTION></span><span class="w"> </span><span class="no">REGEX</span><span class="w"> </span><span class="nv"><regular_expression></span><span class="w"> </span><span class="p">...</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> </div></blockquote> </section> <section id="ordering"> <h2>Ordering<a class="headerlink" href="#ordering" title="Permalink to this heading">ΒΆ</a></h2> <div class="highlight-cmake notranslate" id="reverse"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">REVERSE</span><span class="w"> </span><span class="nv"><list></span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Reverses the contents of the list in-place.</p> <div class="highlight-cmake notranslate" id="sort"><div class="highlight"><pre><span></span><span class="nf">list(</span><span class="no">SORT</span><span class="w"> </span><span class="nv"><list></span><span class="w"> </span><span class="p">[</span><span class="no">COMPARE</span><span class="w"> </span><span class="nv"><compare></span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="no">CASE</span><span class="w"> </span><span class="nv"><case></span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="no">ORDER</span><span class="w"> </span><span class="nv"><order></span><span class="p">]</span><span class="nf">)</span><span class="w"></span> </pre></div> </div> <p>Sorts the list in-place alphabetically.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.13: </span>Added the <code class="docutils literal notranslate"><span class="pre">COMPARE</span></code>, <code class="docutils literal notranslate"><span class="pre">CASE</span></code>, and <code class="docutils literal notranslate"><span class="pre">ORDER</span></code> options.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.18: </span>Added the <code class="docutils literal notranslate"><span class="pre">COMPARE</span> <span class="pre">NATURAL</span></code> option.</p> </div> <p>Use the <code class="docutils literal notranslate"><span class="pre">COMPARE</span></code> keyword to select the comparison method for sorting. The <code class="docutils literal notranslate"><span class="pre"><compare></span></code> option should be one of:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">STRING</span></code>: Sorts a list of strings alphabetically. This is the default behavior if the <code class="docutils literal notranslate"><span class="pre">COMPARE</span></code> option is not given.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">FILE_BASENAME</span></code>: Sorts a list of pathnames of files by their basenames.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">NATURAL</span></code>: Sorts a list of strings using natural order (see <code class="docutils literal notranslate"><span class="pre">strverscmp(3)</span></code> manual), i.e. such that contiguous digits are compared as whole numbers. For example: the following list <cite>10.0 1.1 2.1 8.0 2.0 3.1</cite> will be sorted as <cite>1.1 2.0 2.1 3.1 8.0 10.0</cite> if the <code class="docutils literal notranslate"><span class="pre">NATURAL</span></code> comparison is selected where it will be sorted as <cite>1.1 10.0 2.0 2.1 3.1 8.0</cite> with the <code class="docutils literal notranslate"><span class="pre">STRING</span></code> comparison.</p></li> </ul> <p>Use the <code class="docutils literal notranslate"><span class="pre">CASE</span></code> keyword to select a case sensitive or case insensitive sort mode. The <code class="docutils literal notranslate"><span class="pre"><case></span></code> option should be one of:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">SENSITIVE</span></code>: List items are sorted in a case-sensitive manner. This is the default behavior if the <code class="docutils literal notranslate"><span class="pre">CASE</span></code> option is not given.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">INSENSITIVE</span></code>: List items are sorted case insensitively. The order of items which differ only by upper/lowercase is not specified.</p></li> </ul> <p>To control the sort order, the <code class="docutils literal notranslate"><span class="pre">ORDER</span></code> keyword can be given. The <code class="docutils literal notranslate"><span class="pre"><order></span></code> option should be one of:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">ASCENDING</span></code>: Sorts the list in ascending order. This is the default behavior when the <code class="docutils literal notranslate"><span class="pre">ORDER</span></code> option is not given.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">DESCENDING</span></code>: Sorts the list in descending order.</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="#">list</a><ul> <li><a class="reference internal" href="#synopsis">Synopsis</a></li> <li><a class="reference internal" href="#introduction">Introduction</a></li> <li><a class="reference internal" href="#reading">Reading</a></li> <li><a class="reference internal" href="#search">Search</a></li> <li><a class="reference internal" href="#modification">Modification</a></li> <li><a class="reference internal" href="#ordering">Ordering</a></li> </ul> </li> </ul> </div> <div> <h4>Previous topic</h4> <p class="topless"><a href="include_guard.html" title="previous chapter">include_guard</a></p> </div> <div> <h4>Next topic</h4> <p class="topless"><a href="macro.html" title="next chapter">macro</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/command/list.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="macro.html" title="macro" >next</a> |</li> <li class="right" > <a href="include_guard.html" title="include_guard" >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="">list</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>