ENH: Allow lists in AddExternalProject arguments

The add_external_project function separates its arguments with ';'
separators, so previously no command line argument could contain one.
When specifying CMAKE_ARGS, some -D argument values may need to contain
a semicolon to form lists in the external project cache.

This adds add_external_project argument LIST_SEPARATOR to specify a list
separator string.  The separator is replaced by ';' in arguments to any
command created to drive the external project.  For example:

  add_external_project(...
    LIST_SEPARATOR ::
    CMAKE_ARGS -DSOME_LIST:STRING=A::B::C
    ...)

passes "-DSOME_LIST:STRING=A;B;C" to CMake for the external project.
This commit is contained in:
Brad King
2009-04-09 13:56:08 -04:00
parent dfd95e100d
commit 68248be52e
3 changed files with 15 additions and 0 deletions
+7
View File
@@ -211,6 +211,12 @@ function(add_external_project_step name step)
endif()
get_property(work_dir TARGET ${name} PROPERTY AEP_${step}_WORKING_DIRECTORY)
# Replace list separators.
get_property(sep TARGET ${name} PROPERTY AEP_LIST_SEPARATOR)
if(sep AND command)
string(REPLACE "${sep}" "\\;" command "${command}")
endif()
# Custom comment?
get_property(comment_set TARGET ${name} PROPERTY AEP_${step}_COMMENT SET)
if(comment_set)
@@ -594,6 +600,7 @@ foreach(key IN ITEMS
DOWNLOAD_COMMAND
INSTALL_ARGS
INSTALL_COMMAND
LIST_SEPARATOR
PATCH_COMMAND
SVN_REPOSITORY
SVN_TAG