summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject
diff options
context:
space:
mode:
authorAndrey Pokrovskiy <pokroa@amazon.com>2015-04-17 04:42:19 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-21 14:50:29 (GMT)
commit7bd8cfb813e9bd19cebda92b280beb2deaf052d4 (patch)
treead76020e79e4d286a99a0c19d74a8d4cb7b32837 /Tests/RunCMake/ExternalProject
parent1cf43dcf7c63a61e6254d102314b121623d2086d (diff)
downloadCMake-7bd8cfb813e9bd19cebda92b280beb2deaf052d4.zip
CMake-7bd8cfb813e9bd19cebda92b280beb2deaf052d4.tar.gz
CMake-7bd8cfb813e9bd19cebda92b280beb2deaf052d4.tar.bz2
ExternalProject: Allow generator expressions in initial cache options
Use file(GENERATE) to write the initial cache file so that we can evaluate generator expressions. Use a per-config initial cache file name in case the content varies by configuration.
Diffstat (limited to 'Tests/RunCMake/ExternalProject')
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake2
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake5
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake2
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake5
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake2
-rw-r--r--Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake7
6 files changed, 16 insertions, 7 deletions
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
index c1e4204..c350a63 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
if(NOT EXISTS "${_cache_file}")
set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
index 5e37eec..62b1640 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
@@ -1,5 +1,8 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(CMAKE_BUILD_TYPE Debug)
+endif()
include(ExternalProject)
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
DOWNLOAD_COMMAND ""
- CMAKE_CACHE_ARGS "-DFOO:STRING=BAR")
+ CMAKE_CACHE_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
index ec1cafb..aeee11f 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
if(NOT EXISTS "${_cache_file}")
set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
index 8e98470..3a83dbe 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
@@ -1,5 +1,8 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(CMAKE_BUILD_TYPE Debug)
+endif()
include(ExternalProject)
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
DOWNLOAD_COMMAND ""
- CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=BAR")
+ CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
index 2a07f27..04d49b9 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
if(NOT EXISTS "${_cache_file}")
set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
index e7f26ae..192776b 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
@@ -1,6 +1,9 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(CMAKE_BUILD_TYPE Debug)
+endif()
include(ExternalProject)
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
DOWNLOAD_COMMAND ""
- CMAKE_CACHE_ARGS "-DFOO:STRING=BAR"
- CMAKE_CACHE_DEFAULT_ARGS "-DBAR:STRING=BAZ")
+ CMAKE_CACHE_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>"
+ CMAKE_CACHE_DEFAULT_ARGS "-DBAR:STRING=$<1:BAZ>$<0:BAD>")