[Cmake-commits] [cmake-commits] king committed cmCTestScriptHandler.cxx 1.52 1.53

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jul 31 09:19:21 EDT 2009


Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv25242/Source/CTest

Modified Files:
	cmCTestScriptHandler.cxx 
Log Message:
Set current directory variables in CTest scripts

The commit "Fix get_filename_component ABSOLUTE mode" broke the code

  get_filename_component(cwd . ABSOLUTE)

because CTest scripts did not make cmMakefile::GetCurrentDirectory()
available.  This commit fixes the problem by setting the proper
information on CTest script instances of cmMakefile.

This also makes CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR
available to CTest scripts.  They are set to the working directory at
script startup.


Index: cmCTestScriptHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestScriptHandler.cxx,v
retrieving revision 1.52
retrieving revision 1.53
diff -C 2 -d -r1.52 -r1.53
*** cmCTestScriptHandler.cxx	28 Jul 2009 14:46:46 -0000	1.52
--- cmCTestScriptHandler.cxx	31 Jul 2009 13:19:19 -0000	1.53
***************
*** 338,341 ****
--- 338,347 ----
    this->Makefile = this->LocalGenerator->GetMakefile();
  
+   // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
+   // Also, some commands need Makefile->GetCurrentDirectory().
+   std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
+   this->Makefile->SetStartDirectory(cwd.c_str());
+   this->Makefile->SetStartOutputDirectory(cwd.c_str());
+ 
    // remove all cmake commands which are not scriptable, since they can't be 
    // used in ctest scripts



More information about the Cmake-commits mailing list