summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-22 15:16:43 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-22 15:16:43 (GMT)
commit1468f31988593abdf513e873138a49d758ce8a1c (patch)
tree08e4a7169734a49e3123ccf51bcc57e5f9f51b00 /Tests
parent8f9539287903e514567cf3dfac9636445b3fafa1 (diff)
parentb470d618644808d5d2db20e5bbc09a1d22bf486d (diff)
downloadCMake-1468f31988593abdf513e873138a49d758ce8a1c.zip
CMake-1468f31988593abdf513e873138a49d758ce8a1c.tar.gz
CMake-1468f31988593abdf513e873138a49d758ce8a1c.tar.bz2
Merge topic 'ExternalProject-genex'
b470d618 Help: Add notes for topic 'ExternalProject-genex' 0273ef14 ExternalProject: Allow generator expressions with LOG_* options (#15287) 7bd8cfb8 ExternalProject: Allow generator expressions in initial cache options 1cf43dcf Tests: Add case to cover ExternalProject with subdirectories
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/ExternalProjectSubdir/CMakeLists.txt14
-rw-r--r--Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt10
-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
9 files changed, 52 insertions, 7 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d568a64..eb4dd6b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1326,6 +1326,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set_tests_properties(ExternalProject PROPERTIES
TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
+ add_test(NAME ExternalProjectSubdir
+ COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ExternalProjectSubdir"
+ "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir"
+ ${build_generator_args}
+ --build-project ExternalProjectSubdir
+ --force-new-ctest-process
+ --build-options ${build_options}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
+
add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal"
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt
new file mode 100644
index 0000000..013b418
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.2)
+project(ExternalProjectSubdir NONE)
+include(ExternalProject)
+
+ExternalProject_Add(Subdir1
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Subdir1
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Subdir1
+
+ CMAKE_ARGS -DNORMAL_VAR=NORMAL_VALUE -DGENEX_VAR=$<1:GENEX_VALUE>
+ LOG_CONFIGURE 1
+
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
diff --git a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
new file mode 100644
index 0000000..28107f0
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.2)
+project(Subdir1 NONE)
+
+if(NOT "${NORMAL_VAR}" STREQUAL "NORMAL_VALUE")
+ message(SEND_ERROR "NORMAL_VAR != 'NORMAL_VALUE'")
+endif()
+
+if(NOT "${GENEX_VAR}" STREQUAL "GENEX_VALUE")
+ message(SEND_ERROR "GENEX_VAR != 'GENEX_VALUE'")
+endif()
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>")