summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestScriptHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 2f125aa..b9016af 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -318,16 +318,13 @@ void cmCTestScriptHandler::CreateCMake()
this->GlobalGenerator = new cmGlobalGenerator(this->CMake);
cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot();
+ std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
+ snapshot.GetDirectory().SetCurrentSource(cwd);
+ snapshot.GetDirectory().SetCurrentBinary(cwd);
this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot);
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
- // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
- // Also, some commands need Makefile->GetCurrentSourceDirectory().
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- this->Makefile->SetCurrentSourceDirectory(cwd);
- this->Makefile->SetCurrentBinaryDirectory(cwd);
-
// remove all cmake commands which are not scriptable, since they can't be
// used in ctest scripts
this->CMake->GetState()->RemoveUnscriptableCommands();