From cedeaaa4a285eab4b233e8a34be1e468e917e092 Mon Sep 17 00:00:00 2001
From: Pokrovskiy <pokroa@amazon.com>
Date: Thu, 16 Apr 2015 21:42:19 -0700
Subject: [PATCH 1/3] ExternalProject_Add: Allow generator expressions in
 CMAKE_CACHE_ARGS

---
 Modules/ExternalProject.cmake | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0c73d41..1c7cf51 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1126,10 +1126,7 @@ function(_ep_write_initial_cache target_name script_filename script_initial_cach
   # Replace location tags.
   _ep_replace_location_tags(${target_name} script_initial_cache)
   # Write out the initial cache file to the location specified.
-  if(NOT EXISTS "${script_filename}.in")
-    file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
-  endif()
-  configure_file("${script_filename}.in" "${script_filename}")
+  file(GENERATE OUTPUT "${script_filename}" CONTENT "${script_initial_cache}")
 endfunction()
 
 
-- 
2.3.2 (Apple Git-55)

