summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-07 20:30:59 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-12 13:23:35 (GMT)
commitd1526f825e7464b8cb8a82b73718bbf2eb4965c9 (patch)
tree1830c8bb82b07c4a1c35145b677f975c9104a2b4 /Source/CTest
parent9fc158b6d5ae9902f544fd280c3b087c433fecc6 (diff)
downloadCMake-d1526f825e7464b8cb8a82b73718bbf2eb4965c9.zip
CMake-d1526f825e7464b8cb8a82b73718bbf2eb4965c9.tar.gz
CMake-d1526f825e7464b8cb8a82b73718bbf2eb4965c9.tar.bz2
Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources. Teach it to compute the locations of cmake, ctest, cpack, ccmake, and cmake-gui executables, and the location of CMAKE_ROOT. Provide this information from static cmSystemTools::Get<resource>() methods. Refactor code that needs these locations to use the new APIs. Teach FindCMakeResources to use the OS X system API to lookup the executable location. When running from the CMake build tree itself, leave a file in the tree that FindCMakeResources can use to read the location of the source tree. This avoids the need to compile the source tree location into a binary that may be installed and used without the source tree. Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build tree next to "cmake" and the other tools, as is already done in the install tree for the application bundle. This ensures a consistent set of executables are available in one directory.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx8
3 files changed, 6 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 4fa3c53..5e53dbe 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -59,7 +59,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
{
unsigned int k;
std::vector<std::string> args;
- args.push_back(this->CTest->GetCMakeExecutable());
+ args.push_back(cmSystemTools::GetCMakeCommand());
args.push_back(this->SourceDir);
if(this->BuildGenerator.size())
{
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index db33cb6..5eed409 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
std::string cmakeConfigureCommand = "\"";
- cmakeConfigureCommand += this->CTest->GetCMakeExecutable();
+ cmakeConfigureCommand += cmSystemTools::GetCMakeCommand();
cmakeConfigureCommand += "\"";
std::vector<std::string>::const_iterator it;
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 7d33cf3..00a0a09 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -222,13 +222,13 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
// execute the script passing in the arguments to the script as well as the
// arguments from this invocation of cmake
std::vector<const char*> argv;
- argv.push_back(this->CTest->GetCTestExecutable());
+ argv.push_back(cmSystemTools::GetCTestCommand().c_str());
argv.push_back("-SR");
argv.push_back(total_script_arg.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Executable for CTest is: " <<
- this->CTest->GetCTestExecutable() << "\n");
+ cmSystemTools::GetCTestCommand() << "\n");
// now pass through all the other arguments
std::vector<cmStdString> &initArgs =
@@ -397,9 +397,9 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
this->Makefile->AddDefinition("CTEST_SCRIPT_NAME",
cmSystemTools::GetFilenameName(script).c_str());
this->Makefile->AddDefinition("CTEST_EXECUTABLE_NAME",
- this->CTest->GetCTestExecutable());
+ cmSystemTools::GetCTestCommand().c_str());
this->Makefile->AddDefinition("CMAKE_EXECUTABLE_NAME",
- this->CTest->GetCMakeExecutable());
+ cmSystemTools::GetCMakeCommand().c_str());
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true);
this->UpdateElapsedTime();