[CMake] Fix handling of passing through semi-colon separated lists.
authorChris Bieneman <beanz@apple.com>
Fri, 20 Nov 2015 22:08:49 +0000 (22:08 +0000)
committerChris Bieneman <beanz@apple.com>
Fri, 20 Nov 2015 22:08:49 +0000 (22:08 +0000)
When passing around CMake arguments as lists of arguments any arguments containing lists need to have their semi-colons escaped otherwise CMake will split the arguments in the middle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253719 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/LLVMExternalProjectUtils.cmake

index 63178ce69066f56d7601fff966c57a384920f1d7..01d5e337b8d5abf531ca0e1e8bcbcae14faaa8dc 100644 (file)
@@ -93,8 +93,9 @@ function(llvm_ExternalProject_Add name source_dir)
   get_cmake_property(variableNames VARIABLES)
   foreach(varaibleName ${variableNames})
     if(varaibleName MATCHES "^${nameCanon}")
   get_cmake_property(variableNames VARIABLES)
   foreach(varaibleName ${variableNames})
     if(varaibleName MATCHES "^${nameCanon}")
+      string(REPLACE ";" "\;" value "${${varaibleName}}")
       list(APPEND PASSTHROUGH_VARIABLES
       list(APPEND PASSTHROUGH_VARIABLES
-        -D${varaibleName}=${${varaibleName}})
+        -D${varaibleName}=${${value}})
     endif()
   endforeach()
 
     endif()
   endforeach()