diff options
author | Brad King <brad.king@kitware.com> | 2019-07-26 11:29:19 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-26 07:32:18 -0400 |
commit | 467e6ac728cefa484f9e9369a7da4d05b04ec403 (patch) | |
tree | a5a22d30ca5ab813f3f8f4db40144a132005a68f /Source/CTest/cmCTestScriptHandler.cxx | |
parent | c23c4ed9cf912e265e1070507905b3dbc495a210 (diff) | |
parent | e91bfe440c1419b445ef6746552dd03ba302e6cf (diff) | |
download | cmake-467e6ac728cefa484f9e9369a7da4d05b04ec403.tar.gz |
Merge topic 'definitions_string_view'
e91bfe440c cmMakefile: Let AddDefinition accept a value as cm::string_view
f2ba968ef2 cmMakefile: Simplify and rename AddDefinitionBool
9b5cc42531 cmDefinitions: Remove const char* based Set method
e268840c0a cmDefinitions: Add Unset and cm::string_view based Set methods
451fd329a8 cmDefinitions: Cleanups
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3577
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 85040ddc96..7a5b8d1394 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -168,7 +168,7 @@ void cmCTestScriptHandler::UpdateElapsedTime() auto itime = cmDurationTo<unsigned int>(std::chrono::steady_clock::now() - this->ScriptStartTime); auto timeString = std::to_string(itime); - this->Makefile->AddDefinition("CTEST_ELAPSED_TIME", timeString.c_str()); + this->Makefile->AddDefinition("CTEST_ELAPSED_TIME", timeString); } } @@ -352,21 +352,21 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) this->CreateCMake(); // set a variable with the path to the current script - this->Makefile->AddDefinition( - "CTEST_SCRIPT_DIRECTORY", cmSystemTools::GetFilenamePath(script).c_str()); - this->Makefile->AddDefinition( - "CTEST_SCRIPT_NAME", cmSystemTools::GetFilenameName(script).c_str()); + this->Makefile->AddDefinition("CTEST_SCRIPT_DIRECTORY", + cmSystemTools::GetFilenamePath(script)); + this->Makefile->AddDefinition("CTEST_SCRIPT_NAME", + cmSystemTools::GetFilenameName(script)); this->Makefile->AddDefinition("CTEST_EXECUTABLE_NAME", - cmSystemTools::GetCTestCommand().c_str()); + cmSystemTools::GetCTestCommand()); this->Makefile->AddDefinition("CMAKE_EXECUTABLE_NAME", - cmSystemTools::GetCMakeCommand().c_str()); - this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true); + cmSystemTools::GetCMakeCommand()); + this->Makefile->AddDefinitionBool("CTEST_RUN_CURRENT_SCRIPT", true); this->SetRunCurrentScript(true); this->UpdateElapsedTime(); // add the script arg if defined if (!script_arg.empty()) { - this->Makefile->AddDefinition("CTEST_SCRIPT_ARG", script_arg.c_str()); + this->Makefile->AddDefinition("CTEST_SCRIPT_ARG", script_arg); } #if defined(__CYGWIN__) @@ -398,7 +398,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) const std::map<std::string, std::string>& defs = this->CTest->GetDefinitions(); for (auto const& d : defs) { - this->Makefile->AddDefinition(d.first, d.second.c_str()); + this->Makefile->AddDefinition(d.first, d.second); } // finally read in the script |