diff options
author | Brad King <brad.king@kitware.com> | 2024-03-28 15:50:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-03-28 15:51:04 (GMT) |
commit | 10def6c9646a62c1f260d45297871e84df81c186 (patch) | |
tree | 205ffb0bd971324a98006215b6f5eed690004926 /Modules | |
parent | 2e3692bde08c071fdb00f201eaa6dc0116de436b (diff) | |
parent | 5d33f41e239563cc2f75b6fef1129e78a2613067 (diff) | |
download | CMake-10def6c9646a62c1f260d45297871e84df81c186.zip CMake-10def6c9646a62c1f260d45297871e84df81c186.tar.gz CMake-10def6c9646a62c1f260d45297871e84df81c186.tar.bz2 |
Merge topic 'ExternalProject-list-separator-docs-example'
5d33f41e23 ExternalProject: reword `LIST_SEPARATOR` to indicate what it *does*
611ffce98c ExternalProject: add an example of `LIST_SEPARATOR` usage
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9376
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 5644cf5..b821f1a 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -920,10 +920,21 @@ Miscellaneous Options ``LIST_SEPARATOR <sep>`` For any of the various ``..._COMMAND`` options, and ``CMAKE_ARGS``, - replace ``;`` with ``<sep>`` in the specified command lines. - This can be useful where list variables may be given in commands where - they should end up as space-separated arguments (``<sep>`` would be a - single space character string in this case). + ``ExternalProject`` will replace ``<sep>`` with ``;`` in the specified + command lines. This can be used to ensure a command has a literal ``;`` in it + where direct usage would otherwise be interpreted as argument separators to + CMake APIs instead. Note that the separator should be chosen to avoid being + confused for non-list-separator usages of the sequence. For example, using + ``LIST_SEPARATOR`` allows for passing list values to CMake cache variables on + the command line: + + .. code-block:: cmake + + ExternalProject_Add(example + ... # Download options, etc. + LIST_SEPARATOR "," + CMAKE_ARGS "-DCMAKE_PREFIX_PATH:STRING=${first_prefix},${second_prefix}" + ) ``COMMAND <cmd>...`` Any of the other ``..._COMMAND`` options can have additional commands |