summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/file.rst3
-rw-r--r--Source/cmFileCommand.cxx3
-rw-r--r--Tests/RunCMake/File_Configure/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/SubDir-check.cmake4
-rw-r--r--Tests/RunCMake/File_Configure/SubDir.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt1
6 files changed, 10 insertions, 3 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index b109f9d..db2e580 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -508,8 +508,7 @@ The arguments are:
``OUTPUT <output-file>``
Specify the output file name to generate. A relative path is treated with
- respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`. See policy
- :policy:`CMP0070`.
+ respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
``<output-file>`` does not support generator expressions.
``CONTENT <content>``
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 3eea6f3..cb0f05f 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2862,7 +2862,8 @@ bool HandleConfigureCommand(std::vector<std::string> const& args,
// Check for generator expressions
const std::string input = args[4];
- std::string outputFile = args[2];
+ std::string outputFile = cmSystemTools::CollapseFullPath(
+ args[2], status.GetMakefile().GetCurrentBinaryDirectory());
std::string::size_type pos = input.find_first_of("<>");
if (pos != std::string::npos) {
diff --git a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
index d09d648..0337014 100644
--- a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
@@ -7,3 +7,4 @@ run_cmake(DirOutput)
run_cmake(NewLineStyle-NoArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-WrongArg)
+run_cmake(SubDir)
diff --git a/Tests/RunCMake/File_Configure/SubDir-check.cmake b/Tests/RunCMake/File_Configure/SubDir-check.cmake
new file mode 100644
index 0000000..1e82587
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir-check.cmake
@@ -0,0 +1,4 @@
+set(expected "${RunCMake_TEST_BINARY_DIR}/SubDir/out.txt")
+if(NOT EXISTS "${expected}")
+ set(RunCMake_TEST_FAILED "Expected file not created:\n ${expected}")
+endif()
diff --git a/Tests/RunCMake/File_Configure/SubDir.cmake b/Tests/RunCMake/File_Configure/SubDir.cmake
new file mode 100644
index 0000000..fae60fa
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir.cmake
@@ -0,0 +1 @@
+add_subdirectory(SubDir)
diff --git a/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt
new file mode 100644
index 0000000..6bd962e
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt
@@ -0,0 +1 @@
+file(CONFIGURE OUTPUT out.txt CONTENT "")