summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/find_library.rst6
-rw-r--r--Help/manual/ctest.1.rst6
-rw-r--r--Help/release/dev/ExternalProject-genex.rst6
-rw-r--r--Modules/ExternalProject.cmake47
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCTest.cxx4
-rw-r--r--Source/cmQtAutoGenerators.cxx61
-rw-r--r--Tests/CMakeLists.txt13
-rw-r--r--Tests/ExternalProjectSubdir/CMakeLists.txt29
-rw-r--r--Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt14
-rw-r--r--Tests/QtAutogen/CMakeLists.txt9
-rw-r--r--Tests/QtAutogen/generated.txt.in1
-rw-r--r--Tests/QtAutogen/generated_resource.qrc.in5
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-stderr.txt5
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface.cmake4
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt5
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step.cmake11
-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
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake2
27 files changed, 208 insertions, 50 deletions
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst
index 09df688..e3dcd2b 100644
--- a/Help/command/find_library.rst
+++ b/Help/command/find_library.rst
@@ -34,6 +34,12 @@ default will consider one name at a time and search every directory
for it. The NAMES_PER_DIR option tells this command to consider one
directory at a time and search for all names in it.
+Each library name given to the ``NAMES`` option is first considered
+as a library file name and then considered with platform-specific
+prefixes (e.g. ``lib``) and suffixes (e.g. ``.so``). Therefore one
+may specify library file names such as ``libfoo.a`` directly.
+This can be used to locate static libraries on UNIX-like systems.
+
If the library found is a framework, then VAR will be set to the full
path to the framework <fullPath>/A.framework. When a full path to a
framework is used as a library, CMake will use a -framework A, and a
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 584786f..d0ac28d 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -48,7 +48,9 @@ Options
useful for debugging dashboard problems.
``--output-on-failure``
- Output anything outputted by the test program if the test should fail. This option can also be enabled by setting the environment variable CTEST_OUTPUT_ON_FAILURE
+ Output anything outputted by the test program if the test should fail.
+ This option can also be enabled by setting the environment variable
+ ``CTEST_OUTPUT_ON_FAILURE``.
``-F``
Enable failover.
@@ -62,7 +64,7 @@ Options
This option tells ctest to run the tests in parallel using given
number of jobs. This option can also be set by setting the
- environment variable CTEST_PARALLEL_LEVEL.
+ environment variable ``CTEST_PARALLEL_LEVEL``.
``-Q,--quiet``
Make ctest quiet.
diff --git a/Help/release/dev/ExternalProject-genex.rst b/Help/release/dev/ExternalProject-genex.rst
new file mode 100644
index 0000000..2c7bf8a
--- /dev/null
+++ b/Help/release/dev/ExternalProject-genex.rst
@@ -0,0 +1,6 @@
+ExternalProject-genex
+---------------------
+
+* The :module:`ExternalProject` module APIs learned to support
+ :manual:`generator expressions <cmake-generator-expressions(7)>`
+ when using ``LOG_*`` options and in CMake initial cache options.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0c73d41..97bebc0 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -106,6 +106,8 @@ Create custom targets to build projects in external trees
:manual:`CMake Options <cmake(1)>`. Arguments in the form
``-Dvar:string=on`` are always passed to the command line, and
therefore cannot be changed by the user.
+ Arguments may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
``CMAKE_CACHE_ARGS <arg>...``
Initial cache arguments, of the form ``-Dvar:string=on``.
These arguments are written in a pre-load a script that populates
@@ -113,6 +115,8 @@ Create custom targets to build projects in external trees
overcome command line length limits.
These arguments are :command:`set` using the ``FORCE`` argument,
and therefore cannot be changed by the user.
+ Arguments may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
``CMAKE_CACHE_DEFAULT_ARGS <arg>...``
Initial default cache arguments, of the form ``-Dvar:string=on``.
These arguments are written in a pre-load a script that populates
@@ -121,6 +125,8 @@ Create custom targets to build projects in external trees
These arguments can be used as default value that will be set if no
previous value is found in the cache, and that the user can change
later.
+ Arguments may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
Build step options are:
@@ -267,6 +273,9 @@ specifies to run ``make`` and then ``echo done`` during the build step.
Whether the current working directory is preserved between commands is
not defined. Behavior of shell operators like ``&&`` is not defined.
+Arguments to ``<step>_COMMAND`` or ``COMMAND`` options may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. command:: ExternalProject_Get_Property
The ``ExternalProject_Get_Property`` function retrieves external project
@@ -1126,10 +1135,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()
@@ -1302,14 +1308,14 @@ endif()
endif()
endforeach()
set(code "${code}set(command \"${cmd}\")${code_execute_process}")
- file(WRITE ${stamp_dir}/${name}-${step}-impl.cmake "${code}")
- set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-impl.cmake)
+ file(GENERATE OUTPUT "${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake" CONTENT "${code}")
+ set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
endif()
# Wrap the command in a script to log output to files.
- set(script ${stamp_dir}/${name}-${step}.cmake)
+ set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
set(logbase ${stamp_dir}/${name}-${step})
- file(WRITE ${script} "
+ set(code "
${code_cygpath_make}
set(command \"${command}\")
execute_process(
@@ -1330,6 +1336,7 @@ else()
message(STATUS \"\${msg}\")
endif()
")
+ file(GENERATE OUTPUT "${script}" CONTENT "${code}")
set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
set(${cmd_var} "${command}" PARENT_SCOPE)
endfunction()
@@ -1532,6 +1539,11 @@ function(ExternalProject_Add_StepDependencies name step)
message(FATAL_ERROR "Cannot find target \"${name}\". Perhaps it has not yet been created using ExternalProject_Add.")
endif()
+ get_property(type TARGET ${name} PROPERTY TYPE)
+ if(NOT type STREQUAL "UTILITY")
+ message(FATAL_ERROR "Target \"${name}\" was not generated by ExternalProject_Add.")
+ endif()
+
get_property(is_ep TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT)
if(NOT is_ep)
message(FATAL_ERROR "Target \"${name}\" was not generated by ExternalProject_Add.")
@@ -1544,9 +1556,13 @@ function(ExternalProject_Add_StepDependencies name step)
endif()
if(TARGET ${name}-${step})
+ get_property(type TARGET ${name}-${step} PROPERTY TYPE)
+ if(NOT type STREQUAL "UTILITY")
+ message(FATAL_ERROR "Target \"${name}-${step}\" was not generated by ExternalProject_Add_StepTargets.")
+ endif()
get_property(is_ep_step TARGET ${name}-${step} PROPERTY _EP_IS_EXTERNAL_PROJECT_STEP)
if(NOT is_ep_step)
- message(FATAL_ERROR "Target \"${name}\" was not generated by ExternalProject_Add_StepTargets.")
+ message(FATAL_ERROR "Target \"${name}-${step}\" was not generated by ExternalProject_Add_StepTargets.")
endif()
endif()
@@ -2027,10 +2043,13 @@ function(_ep_add_configure_command name)
set(file_deps)
get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
foreach(dep IN LISTS deps)
- get_property(is_ep TARGET ${dep} PROPERTY _EP_IS_EXTERNAL_PROJECT)
- if(is_ep)
- _ep_get_step_stampfile(${dep} "done" done_stamp_file)
- list(APPEND file_deps ${done_stamp_file})
+ get_property(dep_type TARGET ${dep} PROPERTY TYPE)
+ if(dep_type STREQUAL "UTILITY")
+ get_property(is_ep TARGET ${dep} PROPERTY _EP_IS_EXTERNAL_PROJECT)
+ if(is_ep)
+ _ep_get_step_stampfile(${dep} "done" done_stamp_file)
+ list(APPEND file_deps ${done_stamp_file})
+ endif()
endif()
endforeach()
@@ -2054,7 +2073,7 @@ function(_ep_add_configure_command name)
get_property(cmake_cache_default_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_DEFAULT_ARGS)
if(cmake_cache_args OR cmake_cache_default_args)
- set(_ep_cache_args_script "${tmp_dir}/${name}-cache.cmake")
+ set(_ep_cache_args_script "${tmp_dir}/${name}-cache-$<CONFIG>.cmake")
if(cmake_cache_args)
_ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1)
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4394f24..ba7c94c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150421)
+set(CMake_VERSION_PATCH 20150423)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 3697aa4..403a459 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -332,9 +332,9 @@ cmCTest::cmCTest()
this->ComputedCompressMemCheckOutput = false;
this->RepeatTests = 1; // default to run each test once
this->RepeatUntilFail = false;
- if(cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE"))
+ if(const char* outOnFail = cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE"))
{
- this->OutputTestOutputOnTestFailure = true;
+ this->OutputTestOutputOnTestFailure = !cmSystemTools::IsOff(outOnFail);
}
this->InitStreams();
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 1572dc1..1548c36 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -170,6 +170,17 @@ static std::string getAutogenTargetDir(cmTarget const* target)
return targetDir;
}
+static std::string cmQtAutoGeneratorsStripCR(std::string const& line)
+{
+ // Strip CR characters rcc may have printed (possibly more than one!).
+ std::string::size_type cr = line.find('\r');
+ if (cr != line.npos)
+ {
+ return line.substr(0, cr);
+ }
+ return line;
+}
+
std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
cmTarget const* target,
std::vector<std::string>& depends)
@@ -186,54 +197,56 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
command.push_back(absFile);
- std::string output;
+ std::string rccStdOut;
+ std::string rccStdErr;
int retVal = 0;
- bool result = cmSystemTools::RunSingleCommand(command, &output, &output,
- &retVal, 0,
- cmSystemTools::OUTPUT_NONE);
+ bool result = cmSystemTools::RunSingleCommand(
+ command, &rccStdOut, &rccStdErr,
+ &retVal, 0, cmSystemTools::OUTPUT_NONE);
if (!result || retVal)
{
std::cerr << "AUTOGEN: error: Rcc list process for " << sf->GetFullPath()
- << " failed:\n" << output << std::endl;
+ << " failed:\n" << rccStdOut << "\n" << rccStdErr << std::endl;
return std::string();
}
- std::istringstream ostr(output);
+ {
+ std::istringstream ostr(rccStdOut);
std::string oline;
while(std::getline(ostr, oline))
{
- // Strip CR characters rcc may have printed (possibly more than one!).
- std::string::size_type cr = oline.find('\r');
- if (cr != oline.npos)
+ oline = cmQtAutoGeneratorsStripCR(oline);
+ if(!oline.empty())
{
- oline = oline.substr(0, cr);
+ qrcEntries.push_back(oline);
}
+ }
+ }
- if (oline.empty())
- {
- // The output of rcc --list contains many empty lines.
- continue;
- }
- if (cmHasLiteralPrefix(oline, "RCC: Error in"))
+ {
+ std::istringstream estr(rccStdErr);
+ std::string eline;
+ while(std::getline(estr, eline))
+ {
+ eline = cmQtAutoGeneratorsStripCR(eline);
+ if (cmHasLiteralPrefix(eline, "RCC: Error in"))
{
static std::string searchString = "Cannot find file '";
- std::string::size_type pos = oline.find(searchString);
+ std::string::size_type pos = eline.find(searchString);
if (pos == std::string::npos)
{
std::cerr << "AUTOGEN: error: Rcc lists unparsable output "
- << oline << std::endl;
+ << eline << std::endl;
return std::string();
}
pos += searchString.length();
- std::string::size_type sz = oline.size() - pos - 1;
- qrcEntries.push_back(oline.substr(pos, sz));
- }
- else
- {
- qrcEntries.push_back(oline);
+ std::string::size_type sz = eline.size() - pos - 1;
+ qrcEntries.push_back(eline.substr(pos, sz));
}
}
+ }
+
depends.insert(depends.end(), qrcEntries.begin(), qrcEntries.end());
return cmJoin(qrcEntries, "@list_sep@");
}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 699b616..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"
@@ -2680,6 +2692,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_TEST_MACRO(CTestTestSerialOrder ${CMAKE_CTEST_COMMAND}
--output-on-failure -C "\${CTestTest_CONFIG}")
+ set_property(TEST CTestTestSerialOrder PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
if(NOT BORLAND)
set(CTestLimitDashJ_CTEST_OPTIONS --force-new-ctest-process)
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt
new file mode 100644
index 0000000..e65087a
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.2)
+project(ExternalProjectSubdir NONE)
+include(ExternalProject)
+
+# Remove the custom target output to be sure it runs in an
+# incremental test. Skip this on VS 6 because it sometimes
+# re-runs CMake after the custom command runs.
+if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6")
+ file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt)
+endif()
+
+add_custom_target(PreSubdir1
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt
+ )
+add_library(PreSubdir1Interface INTERFACE)
+add_dependencies(PreSubdir1Interface PreSubdir1)
+
+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 ""
+
+ DEPENDS PreSubdir1Interface
+ )
diff --git a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
new file mode 100644
index 0000000..2303c3e
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
@@ -0,0 +1,14 @@
+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()
+
+if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/../PreSubdir1.txt")
+ message(SEND_ERROR "../PreSubdir1.txt not provided!")
+endif()
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index f76d11e..60b44fd 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -63,7 +63,15 @@ add_library(codeeditorLib STATIC codeeditor.cpp)
add_library(privateSlot OBJECT private_slot.cpp)
+configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY)
+add_custom_command(
+ OUTPUT generated.txt
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in"
+ )
+
add_custom_target(generate_moc_input
+ DEPENDS generated.txt
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
)
@@ -89,6 +97,7 @@ add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.c
multiplewidgets.cpp
xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs}
+ ${CMAKE_CURRENT_BINARY_DIR}/generated_resource.qrc
)
set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
diff --git a/Tests/QtAutogen/generated.txt.in b/Tests/QtAutogen/generated.txt.in
new file mode 100644
index 0000000..77507bb
--- /dev/null
+++ b/Tests/QtAutogen/generated.txt.in
@@ -0,0 +1 @@
+Some generated text file.
diff --git a/Tests/QtAutogen/generated_resource.qrc.in b/Tests/QtAutogen/generated_resource.qrc.in
new file mode 100644
index 0000000..da5fa62
--- /dev/null
+++ b/Tests/QtAutogen/generated_resource.qrc.in
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>generated.txt</file>
+</qresource>
+</RCC>
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 2e5156c..22a8d20 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
include(RunCMake)
+unset(ENV{CTEST_PARALLEL_LEVEL})
+unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+
run_cmake_command(repeat-until-fail-bad1
${CMAKE_CTEST_COMMAND} --repeat-until-fail
)
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-result.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-stderr.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-stderr.txt
new file mode 100644
index 0000000..1c0b601
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ Target "SomeInterface" was not generated by ExternalProject_Add.
+Call Stack \(most recent call first\):
+ Add_StepDependencies_iface.cmake:[0-9]+ \(ExternalProject_Add_StepDependencies\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface.cmake
new file mode 100644
index 0000000..f7cfde1
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface.cmake
@@ -0,0 +1,4 @@
+include(ExternalProject)
+
+add_library(SomeInterface INTERFACE)
+ExternalProject_Add_StepDependencies(SomeInterface step dep)
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-result.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt
new file mode 100644
index 0000000..22e13bf
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ Target "MyProj-IFace" was not generated by ExternalProject_Add_StepTargets.
+Call Stack \(most recent call first\):
+ Add_StepDependencies_iface_step.cmake:[0-9]+ \(ExternalProject_Add_StepDependencies\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step.cmake
new file mode 100644
index 0000000..0289493
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step.cmake
@@ -0,0 +1,11 @@
+include(ExternalProject)
+
+ExternalProject_Add(MyProj
+ DOWNLOAD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
+
+add_library(MyProj-IFace INTERFACE)
+ExternalProject_Add_StepDependencies(MyProj IFace dep)
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>")
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index 0f5dcef..a82ffc9 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -5,4 +5,6 @@ run_cmake(CMAKE_CACHE_DEFAULT_ARGS)
run_cmake(CMAKE_CACHE_mix)
run_cmake(NO_DEPENDS)
run_cmake(Add_StepDependencies)
+run_cmake(Add_StepDependencies_iface)
+run_cmake(Add_StepDependencies_iface_step)
run_cmake(Add_StepDependencies_no_target)