summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestBZR.cxx5
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx5
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx13
-rw-r--r--Source/CTest/cmCTestCurl.cxx7
-rw-r--r--Source/CTest/cmCTestHG.cxx5
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx6
-rw-r--r--Source/CTest/cmCTestP4.cxx5
-rw-r--r--Source/CTest/cmCTestSVN.cxx7
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx16
-rw-r--r--Source/CTest/cmProcess.cxx5
-rw-r--r--Source/cmAddCustomCommandCommand.cxx4
-rw-r--r--Source/cmAddLibraryCommand.cxx5
-rw-r--r--Source/cmAlgorithms.h27
-rw-r--r--Source/cmCTest.cxx10
-rw-r--r--Source/cmConditionEvaluator.cxx4
-rw-r--r--Source/cmCustomCommand.cxx8
-rw-r--r--Source/cmCustomCommandGenerator.cxx9
-rw-r--r--Source/cmDocumentationSection.h5
-rw-r--r--Source/cmELF.cxx5
-rw-r--r--Source/cmExecuteProcessCommand.cxx5
-rw-r--r--Source/cmExportBuildFileGenerator.cxx1
-rw-r--r--Source/cmExportBuildFileGenerator.h5
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx10
-rw-r--r--Source/cmFileAPICodemodel.cxx5
-rw-r--r--Source/cmFileCommand.cxx12
-rw-r--r--Source/cmFileMonitor.cxx35
-rw-r--r--Source/cmFileMonitor.h3
-rw-r--r--Source/cmFindBase.cxx5
-rw-r--r--Source/cmFindCommon.cxx5
-rw-r--r--Source/cmFunctionCommand.cxx4
-rw-r--r--Source/cmGeneratorExpressionParser.cxx4
-rw-r--r--Source/cmGlobalGenerator.h5
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx7
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx5
-rw-r--r--Source/cmIDEOptions.cxx6
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx7
-rw-r--r--Source/cmInstalledFile.cxx17
-rw-r--r--Source/cmInstalledFile.h4
-rw-r--r--Source/cmJsonObjects.cxx5
-rw-r--r--Source/cmLocalGenerator.cxx3
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx5
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx4
-rw-r--r--Source/cmMacroCommand.cxx4
-rw-r--r--Source/cmMakefile.cxx3
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx8
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx10
-rw-r--r--Source/cmMakefileTargetGenerator.cxx24
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
-rw-r--r--Source/cmOrderDirectories.cxx29
-rw-r--r--Source/cmOrderDirectories.h6
-rw-r--r--Source/cmQtAutoGen.cxx6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx6
-rw-r--r--Source/cmQtAutoMocUic.cxx14
-rw-r--r--Source/cmQtAutoRcc.cxx5
-rw-r--r--Source/cmSetTargetPropertiesCommand.cxx5
-rw-r--r--Source/cmSetTestsPropertiesCommand.cxx5
-rw-r--r--Source/cmStateDirectory.cxx3
-rw-r--r--Source/cmSystemTools.cxx17
-rw-r--r--Source/cmTarget.cxx33
-rw-r--r--Source/cmake.cxx4
-rw-r--r--Source/cmakemain.cxx21
-rw-r--r--Source/cmcmd.cxx8
68 files changed, 284 insertions, 261 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 88afed4..029c4ac 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 20191217)
+set(CMake_VERSION_PATCH 20191220)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 8640c46..c87fb83b 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -8,11 +8,12 @@
#include <ostream>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
#include "cm_expat.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -245,7 +246,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 9cb5449..03a3fd3 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -7,11 +7,12 @@
#include <set>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmDuration.h"
#include "cmFileTimeCache.h"
@@ -969,7 +970,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
if (it != queue->end()) {
// Create a contiguous array for the line
this->CurrentProcessingLine.clear();
- cmAppend(this->CurrentProcessingLine, queue->begin(), it);
+ cm::append(this->CurrentProcessingLine, queue->begin(), it);
this->CurrentProcessingLine.push_back(0);
const char* line = this->CurrentProcessingLine.data();
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 4cd783f..2c8f119 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -12,12 +12,13 @@
#include <sstream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
@@ -819,7 +820,7 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
std::string binaryDir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string binCoverageFile = binaryDir + "/*jacoco.xml";
g2.FindFiles(binCoverageFile);
- cmAppend(files, g2.GetFiles());
+ cm::append(files, g2.GetFiles());
if (!files.empty()) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1462,7 +1463,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
" looking for LCOV files in: " << daGlob << std::endl, this->Quiet);
gl.FindFiles(daGlob);
// Keep a list of all LCOV files
- cmAppend(lcovFiles, gl.GetFiles());
+ cm::append(lcovFiles, gl.GetFiles());
for (std::string const& file : lcovFiles) {
lcovFile = file;
@@ -1599,10 +1600,10 @@ void cmCTestCoverageHandler::FindGCovFiles(std::vector<std::string>& files)
" globbing for coverage in: " << lm.first << std::endl, this->Quiet);
std::string daGlob = cmStrCat(lm.first, "/*.da");
gl.FindFiles(daGlob);
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
daGlob = cmStrCat(lm.first, "/*.gcda");
gl.FindFiles(daGlob);
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
}
}
@@ -1638,7 +1639,7 @@ bool cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
"Error while finding files matching " << daGlob << std::endl);
return false;
}
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Now searching in: " << daGlob << std::endl, this->Quiet);
return true;
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index ccac832..3ad4749 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -5,7 +5,8 @@
#include <cstdio>
#include <ostream>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmCTest.h"
#include "cmCurl.h"
#include "cmStringAlgorithms.h"
@@ -46,14 +47,14 @@ size_t curlWriteMemoryCallback(void* ptr, size_t size, size_t nmemb,
{
int realsize = static_cast<int>(size * nmemb);
const char* chPtr = static_cast<char*>(ptr);
- cmAppend(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
+ cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
return realsize;
}
size_t curlDebugCallback(CURL* /*unused*/, curl_infotype /*unused*/,
char* chPtr, size_t size, void* data)
{
- cmAppend(*static_cast<std::vector<char>*>(data), chPtr, chPtr + size);
+ cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + size);
return size;
}
}
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 3265498..5f4581e 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -5,9 +5,10 @@
#include <ostream>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -204,7 +205,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 04abf98..37679b9 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -19,6 +19,8 @@
#include <utility>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
#include "cmsys/SystemInformation.hxx"
@@ -788,7 +790,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
// Sort tests within each level by COST and append them to the cost list.
for (TestSet const& currentSet : cmReverseRange(priorityStack)) {
TestList sortedCopy;
- cmAppend(sortedCopy, currentSet);
+ cm::append(sortedCopy, currentSet);
std::stable_sort(sortedCopy.begin(), sortedCopy.end(),
TestComparator(this));
@@ -1154,7 +1156,7 @@ static Json::Value DumpCTestInfo(
const std::vector<std::string>& args = testRun.GetArguments();
if (!args.empty()) {
commandAndArgs.reserve(args.size() + 1);
- cmAppend(commandAndArgs, args);
+ cm::append(commandAndArgs, args);
}
testInfo["command"] = DumpToJsonArray(commandAndArgs);
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index e2063e1..1375be4 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -7,9 +7,10 @@
#include <ostream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -326,7 +327,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
// options before the main command
std::string opts = this->CTest->GetCTestConfiguration("P4Options");
- cmAppend(P4Options, cmSystemTools::ParseArguments(opts));
+ cm::append(P4Options, cmSystemTools::ParseArguments(opts));
}
CommandOptions.clear();
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 34395c9..44dfab2 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -7,9 +7,10 @@
#include <map>
#include <ostream>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -271,7 +272,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
std::vector<char const*> args;
args.push_back(this->CommandLineTool.c_str());
- cmAppend(args, parameters);
+ cm::append(args, parameters);
args.push_back("--non-interactive");
std::string userOptions = this->CTest->GetCTestConfiguration("SVNOptions");
@@ -344,7 +345,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 2ac5af6..a8f201a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -7,6 +7,8 @@
#include <cstdlib>
#include <sstream>
+#include <cmext/algorithm>
+
#include "cm_curl.h"
#include "cm_jsoncpp_reader.h"
#include "cm_jsoncpp_value.h"
@@ -65,7 +67,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CurrentValue, data, data + length);
+ cm::append(this->CurrentValue, data, data + length);
}
void EndElement(const std::string& name) override
@@ -96,8 +98,8 @@ static size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size,
{
int realsize = static_cast<int>(size * nmemb);
const char* chPtr = static_cast<char*>(ptr);
- cmAppend(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
- chPtr + realsize);
+ cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
+ chPtr + realsize);
return realsize;
}
@@ -106,8 +108,8 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
char* chPtr, size_t size,
void* data)
{
- cmAppend(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
- chPtr + size);
+ cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
+ chPtr + size);
return size;
}
@@ -768,7 +770,7 @@ int cmCTestSubmitHandler::ProcessHandler()
if (!this->Files.empty()) {
// Submit the explicitly selected files:
- cmAppend(files, this->Files);
+ cm::append(files, this->Files);
}
// Add to the list of files to submit from any selected, existing parts:
@@ -814,7 +816,7 @@ int cmCTestSubmitHandler::ProcessHandler()
}
// Submit files from this part.
- cmAppend(files, this->CTest->GetSubmitFiles(p));
+ cm::append(files, this->CTest->GetSubmitFiles(p));
}
// Make sure files are unique, but preserve order.
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 87f7147..2ec9622 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -6,9 +6,10 @@
#include <iostream>
#include <string>
+#include <cmext/algorithm>
+
#include "cmsys/Process.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestRunTest.h"
#include "cmCTestTestHandler.h"
@@ -218,7 +219,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf)
if (nread > 0) {
std::string strdata;
this->Conv.DecodeText(buf->base, static_cast<size_t>(nread), strdata);
- cmAppend(this->Output, strdata);
+ cm::append(this->Output, strdata);
while (this->Output.GetLine(line)) {
this->Runner.CheckOutput(line);
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 52fc5d5..995088c 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -261,9 +261,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
case doing_target:
target = copy;
break;
- case doing_depends: {
+ case doing_depends:
depends.push_back(copy);
- } break;
+ break;
case doing_outputs:
outputs.push_back(filename);
break;
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 0439c51..f443fc6 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -2,7 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddLibraryCommand.h"
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
@@ -309,7 +310,7 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
return true;
}
- cmAppend(srclists, s, args.end());
+ cm::append(srclists, s, args.end());
mf.AddLibrary(libName, type, srclists, excludeFromAll);
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index def3ac7..a179acb 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -145,33 +145,6 @@ void cmDeleteAll(Range const& r)
ContainerAlgorithms::DefaultDeleter<Range>());
}
-template <typename T>
-void cmAppend(std::vector<std::unique_ptr<T>>& v,
- std::vector<std::unique_ptr<T>>&& r)
-{
- std::transform(r.begin(), r.end(), std::back_inserter(v),
- [](std::unique_ptr<T>& item) { return std::move(item); });
-}
-
-template <typename T>
-void cmAppend(std::vector<T*>& v, std::vector<std::unique_ptr<T>> const& r)
-{
- std::transform(r.begin(), r.end(), std::back_inserter(v),
- [](const std::unique_ptr<T>& item) { return item.get(); });
-}
-
-template <typename T, typename Range>
-void cmAppend(std::vector<T>& v, Range const& r)
-{
- v.insert(v.end(), r.begin(), r.end());
-}
-
-template <typename T, typename InputIt>
-void cmAppend(std::vector<T>& v, InputIt first, InputIt last)
-{
- v.insert(v.end(), first, last);
-}
-
template <typename Range>
typename Range::const_iterator cmRemoveN(Range& r, size_t n)
{
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 76a2bba..22a6e38 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -33,8 +33,8 @@
#endif
#include <cm/memory>
+#include <cmext/algorithm>
-#include "cmAlgorithms.h"
#include "cmCTestBuildAndTestHandler.h"
#include "cmCTestBuildHandler.h"
#include "cmCTestConfigureHandler.h"
@@ -1280,7 +1280,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
if (output) {
- cmAppend(tempOutput, data, data + length);
+ cm::append(tempOutput, data, data + length);
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
cmCTestLogWrite(strdata.c_str(), strdata.size()));
@@ -2243,7 +2243,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
bool SRArgumentSpecified = false;
// copy the command line
- cmAppend(this->Impl->InitialCommandLineArguments, args);
+ cm::append(this->Impl->InitialCommandLineArguments, args);
// process the command line arguments
for (size_t i = 1; i < args.size(); ++i) {
@@ -3003,10 +3003,10 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
res = cmsysProcess_WaitForData(cp, &data, &length, nullptr);
switch (res) {
case cmsysProcess_Pipe_STDOUT:
- cmAppend(tempOutput, data, data + length);
+ cm::append(tempOutput, data, data + length);
break;
case cmsysProcess_Pipe_STDERR:
- cmAppend(tempError, data, data + length);
+ cm::append(tempError, data, data + length);
break;
default:
done = true;
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 003e60d..fda687f 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -9,6 +9,8 @@
#include <sstream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
#include "cmAlgorithms.h"
@@ -396,7 +398,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
// copy to the list structure
auto argP1 = arg;
argP1++;
- cmAppend(newArgs2, argP1, argClose);
+ cm::append(newArgs2, argP1, argClose);
newArgs2.pop_back();
// now recursively invoke IsTrue to handle the values inside the
// parenthetical expression
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 7cc3c04..0dd8722 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -4,7 +4,7 @@
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
cmCustomCommand::cmCustomCommand(std::vector<std::string> outputs,
std::vector<std::string> byproducts,
@@ -51,12 +51,12 @@ const char* cmCustomCommand::GetComment() const
void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
{
- cmAppend(this->CommandLines, commandLines);
+ cm::append(this->CommandLines, commandLines);
}
void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
{
- cmAppend(this->Depends, depends);
+ cm::append(this->Depends, depends);
}
bool cmCustomCommand::GetEscapeOldStyle() const
@@ -96,7 +96,7 @@ void cmCustomCommand::SetImplicitDepends(cmImplicitDependsList const& l)
void cmCustomCommand::AppendImplicitDepends(cmImplicitDependsList const& l)
{
- cmAppend(this->ImplicitDepends, l);
+ cm::append(this->ImplicitDepends, l);
}
bool cmCustomCommand::GetUsesTerminal() const
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 955f03b..c568253 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -6,6 +6,8 @@
#include <memory>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
@@ -28,11 +30,14 @@ void AppendPaths(const std::vector<std::string>& inputs,
cmExpandedList(cge->Evaluate(lg, config));
for (std::string& it : result) {
cmSystemTools::ConvertToUnixSlashes(it);
+ if (cmContains(it, '/') && !cmSystemTools::FileIsFullPath(it)) {
+ it = cmStrCat(lg->GetMakefile()->GetCurrentBinaryDirectory(), '/', it);
+ }
if (cmSystemTools::FileIsFullPath(it)) {
it = cmSystemTools::CollapseFullPath(it);
}
}
- cmAppend(output, result);
+ cm::append(output, result);
}
}
}
@@ -56,7 +61,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(clarg);
std::string parsed_arg = cge->Evaluate(this->LG, this->Config);
if (this->CC.GetCommandExpandLists()) {
- cmAppend(argv, cmExpandedList(parsed_arg));
+ cm::append(argv, cmExpandedList(parsed_arg));
} else {
argv.push_back(std::move(parsed_arg));
}
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index 15cada6..641263d 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -8,7 +8,8 @@
#include <string>
#include <vector>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmDocumentationEntry.h"
// Low-level interface for custom documents:
@@ -47,7 +48,7 @@ public:
}
void Append(const std::vector<cmDocumentationEntry>& entries)
{
- cmAppend(this->Entries, entries);
+ cm::append(this->Entries, entries);
}
/** Append an entry to this section using NULL terminated chars */
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 5976b2f..202b205 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -10,13 +10,12 @@
#include <vector>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cm_kwiml.h"
-#include "cmAlgorithms.h"
-
// Include the ELF format information system header.
#if defined(__OpenBSD__)
# include <elf_abi.h>
@@ -578,7 +577,7 @@ std::vector<char> cmELFInternalImpl<Types>::EncodeDynamicEntries(
}
char* pdyn = reinterpret_cast<char*>(&dyn);
- cmAppend(result, pdyn, pdyn + sizeof(ELF_Dyn));
+ cm::append(result, pdyn, pdyn + sizeof(ELF_Dyn));
}
return result;
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 80e4bcd..5be5bce 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -9,11 +9,12 @@
#include <memory>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/Process.h"
#include "cm_static_string_view.hxx"
-#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -402,6 +403,6 @@ void cmExecuteProcessCommandAppend(std::vector<char>& output, const char* data,
--length;
}
#endif
- cmAppend(output, data, data + length);
+ cm::append(output, data, data + length);
}
}
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 7e9a987..dbe5a5e 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -8,6 +8,7 @@
#include <sstream>
#include <utility>
+#include "cmAlgorithms.h"
#include "cmExportSet.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 11fbd02..66e8cbb 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -10,7 +10,8 @@
#include <utility>
#include <vector>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExportFileGenerator.h"
#include "cmStateTypes.h"
@@ -41,7 +42,7 @@ public:
void GetTargets(std::vector<std::string>& targets) const;
void AppendTargets(std::vector<std::string> const& targets)
{
- cmAppend(this->Targets, targets);
+ cm::append(this->Targets, targets);
}
void SetExportSet(cmExportSet*);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index d1da2d7..b710467 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -8,6 +8,8 @@
#include <set>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -210,7 +212,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// Collect all files
std::vector<std::string> listFiles;
for (cmLocalGenerator* lg : it.second) {
- cmAppend(listFiles, lg->GetMakefile()->GetListFiles());
+ cm::append(listFiles, lg->GetMakefile()->GetListFiles());
}
// Convert
@@ -558,19 +560,19 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
{
std::vector<std::string> includes;
lg->GetIncludeDirectories(includes, target, "C", buildType);
- cmAppend(allIncludeDirs, includes);
+ cm::append(allIncludeDirs, includes);
}
std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) {
- cmAppend(allIncludeDirs, cmExpandedList(systemIncludeDirs));
+ cm::append(allIncludeDirs, cmExpandedList(systemIncludeDirs));
}
systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) {
- cmAppend(allIncludeDirs, cmExpandedList(systemIncludeDirs));
+ cm::append(allIncludeDirs, cmExpandedList(systemIncludeDirs));
}
auto end = cmRemoveDuplicates(allIncludeDirs);
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index d6afb77..7a2d9d5 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -15,9 +15,10 @@
#include <utility>
#include <vector>
+#include <cmext/algorithm>
+
#include "cm_jsoncpp_value.h"
-#include "cmAlgorithms.h"
#include "cmCryptoHash.h"
#include "cmFileAPI.h"
#include "cmGeneratorExpression.h"
@@ -555,7 +556,7 @@ Json::Value CodemodelConfig::DumpTargets()
cmGlobalGenerator* gg =
this->FileAPI.GetCMakeInstance()->GetGlobalGenerator();
for (const auto& lg : gg->GetLocalGenerators()) {
- cmAppend(targetList, lg->GetGeneratorTargets());
+ cm::append(targetList, lg->GetGeneratorTargets());
}
std::sort(targetList.begin(), targetList.end(),
[](cmGeneratorTarget* l, cmGeneratorTarget* r) {
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d55b959..1fdfa87 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -15,6 +15,7 @@
#include <vector>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
@@ -24,7 +25,6 @@
#include "cm_static_string_view.hxx"
#include "cm_sys_stat.h"
-#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
#include "cmCryptoHash.h"
#include "cmExecutionStatus.h"
@@ -783,7 +783,7 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
}
std::vector<std::string>& foundFiles = g.GetFiles();
- cmAppend(files, foundFiles);
+ cm::append(files, foundFiles);
if (configureDepends) {
std::sort(foundFiles.begin(), foundFiles.end());
@@ -1394,8 +1394,8 @@ size_t cmWriteToMemoryCallback(void* ptr, size_t size, size_t nmemb,
{
int realsize = static_cast<int>(size * nmemb);
const char* chPtr = static_cast<char*>(ptr);
- cmAppend(*static_cast<cmFileCommandVectorOfChar*>(data), chPtr,
- chPtr + realsize);
+ cm::append(*static_cast<cmFileCommandVectorOfChar*>(data), chPtr,
+ chPtr + realsize);
return realsize;
}
@@ -1408,7 +1408,7 @@ size_t cmFileCommandCurlDebugCallback(CURL*, curl_infotype type, char* chPtr,
case CURLINFO_TEXT:
case CURLINFO_HEADER_IN:
case CURLINFO_HEADER_OUT:
- cmAppend(vec, chPtr, chPtr + size);
+ cm::append(vec, chPtr, chPtr + size);
break;
case CURLINFO_DATA_IN:
case CURLINFO_DATA_OUT:
@@ -1418,7 +1418,7 @@ size_t cmFileCommandCurlDebugCallback(CURL*, curl_infotype type, char* chPtr,
int n = sprintf(buf, "[%" KWIML_INT_PRIu64 " bytes data]\n",
static_cast<KWIML_INT_uint64_t>(size));
if (n > 0) {
- cmAppend(vec, buf, buf + n);
+ cm::append(vec, buf, buf + n);
}
} break;
default:
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index ac8a37e..8cfdb2d 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -7,9 +7,9 @@
#include <unordered_map>
#include <utility>
-#include "cmsys/SystemTools.hxx"
+#include <cm/memory>
-#include "cmAlgorithms.h"
+#include "cmsys/SystemTools.hxx"
namespace {
void on_directory_change(uv_fs_event_t* handle, const char* filename,
@@ -37,12 +37,12 @@ public:
class cmVirtualDirectoryWatcher : public cmIBaseWatcher
{
public:
- ~cmVirtualDirectoryWatcher() override { cmDeleteAll(this->Children); }
+ ~cmVirtualDirectoryWatcher() override = default;
cmIBaseWatcher* Find(const std::string& ps)
{
const auto i = this->Children.find(ps);
- return (i == this->Children.end()) ? nullptr : i->second;
+ return (i == this->Children.end()) ? nullptr : i->second.get();
}
void Trigger(const std::string& pathSegment, int events,
@@ -96,11 +96,7 @@ public:
return result;
}
- void Reset()
- {
- cmDeleteAll(this->Children);
- this->Children.clear();
- }
+ void Reset() { this->Children.clear(); }
void AddChildWatcher(const std::string& ps, cmIBaseWatcher* watcher)
{
@@ -108,11 +104,12 @@ public:
assert(this->Children.find(ps) == this->Children.end());
assert(watcher);
- this->Children.emplace(std::make_pair(ps, watcher));
+ this->Children.emplace(ps, std::unique_ptr<cmIBaseWatcher>(watcher));
}
private:
- std::unordered_map<std::string, cmIBaseWatcher*> Children; // owned!
+ std::unordered_map<std::string, std::unique_ptr<cmIBaseWatcher>>
+ Children; // owned!
};
// Root of all the different (on windows!) root directories:
@@ -295,14 +292,11 @@ void on_fs_close(uv_handle_t* handle)
} // namespace
cmFileMonitor::cmFileMonitor(uv_loop_t* l)
- : Root(new cmRootWatcher(l))
+ : Root(cm::make_unique<cmRootWatcher>(l))
{
}
-cmFileMonitor::~cmFileMonitor()
-{
- delete this->Root;
-}
+cmFileMonitor::~cmFileMonitor() = default;
void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
Callback const& cb)
@@ -316,7 +310,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
if (segmentCount < 2) { // Expect at least rootdir and filename
continue;
}
- cmVirtualDirectoryWatcher* currentWatcher = this->Root;
+ cmVirtualDirectoryWatcher* currentWatcher = this->Root.get();
for (size_t i = 0; i < segmentCount; ++i) {
assert(currentWatcher);
@@ -334,11 +328,12 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
cmIBaseWatcher* nextWatcher = currentWatcher->Find(currentSegment);
if (!nextWatcher) {
if (rootSegment) { // Root part
- assert(currentWatcher == this->Root);
- nextWatcher = new cmRootDirectoryWatcher(this->Root, currentSegment);
+ assert(currentWatcher == this->Root.get());
+ nextWatcher =
+ new cmRootDirectoryWatcher(this->Root.get(), currentSegment);
assert(currentWatcher->Find(currentSegment) == nextWatcher);
} else if (fileSegment) { // File part
- assert(currentWatcher != this->Root);
+ assert(currentWatcher != this->Root.get());
nextWatcher = new cmFileWatcher(
dynamic_cast<cmRealDirectoryWatcher*>(currentWatcher),
currentSegment, cb);
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index 7ffc929..b510a2c 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <functional>
+#include <memory>
#include <string>
#include <vector>
@@ -30,5 +31,5 @@ public:
std::vector<std::string> WatchedDirectories() const;
private:
- cmRootWatcher* Root;
+ std::unique_ptr<cmRootWatcher> Root;
};
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index d5fa610..bec99bb 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -7,7 +7,8 @@
#include <map>
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmMakefile.h"
#include "cmRange.h"
#include "cmSearchPath.h"
@@ -155,7 +156,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
std::vector<std::string> shortArgs = this->Names;
this->Names.clear(); // clear out any values in Names
this->Names.push_back(shortArgs[0]);
- cmAppend(this->UserGuessArgs, shortArgs.begin() + 1, shortArgs.end());
+ cm::append(this->UserGuessArgs, shortArgs.begin() + 1, shortArgs.end());
}
this->ExpandPaths();
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 92317bb..82acfed 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -7,7 +7,8 @@
#include <cstring>
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -266,7 +267,7 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// If searching both rooted and unrooted paths add the original
// paths again.
if (this->FindRootPathMode == RootPathModeBoth) {
- cmAppend(paths, unrootedPaths);
+ cm::append(paths, unrootedPaths);
}
}
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 4b2f145..a4c9072 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -6,10 +6,10 @@
#include <cm/memory>
#include <cm/string_view>
+#include <cmext/algorithm>
#include "cm_static_string_view.hxx"
-#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -181,7 +181,7 @@ bool cmFunctionCommand(std::vector<std::string> const& args,
// create a function blocker
auto fb = cm::make_unique<cmFunctionFunctionBlocker>();
- cmAppend(fb->Args, args);
+ cm::append(fb->Args, args);
status.GetMakefile().AddFunctionBlocker(std::move(fb));
return true;
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 4159a7b..c2c9ef7 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -7,9 +7,9 @@
#include <utility>
#include <cm/memory>
+#include <cmext/algorithm>
#include <cmext/memory>
-#include "cmAlgorithms.h"
#include "cmGeneratorExpressionEvaluator.h"
cmGeneratorExpressionParser::cmGeneratorExpressionParser(
@@ -57,7 +57,7 @@ static void extendResult(
cm::static_reference_cast<TextContent>(contents.front()).GetLength());
contents.erase(contents.begin());
}
- cmAppend(result, std::move(contents));
+ cm::append(result, std::move(contents));
}
void cmGeneratorExpressionParser::ParseGeneratorExpression(
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 107df4d..f3078ac 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -14,9 +14,10 @@
#include <utility>
#include <vector>
+#include <cmext/algorithm>
+
#include "cm_codecvt.hxx"
-#include "cmAlgorithms.h"
#include "cmCustomCommandLines.h"
#include "cmDuration.h"
#include "cmExportSet.h"
@@ -71,7 +72,7 @@ struct GeneratedMakeCommand
void Add(std::vector<std::string>::const_iterator start,
std::vector<std::string>::const_iterator end)
{
- cmAppend(PrimaryCommand, start, end);
+ cm::append(PrimaryCommand, start, end);
}
std::string Printable() const { return cmJoin(PrimaryCommand, " "); }
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index ff54288..fc3123a 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -66,7 +66,7 @@ cmGlobalJOMMakefileGenerator::GenerateBuildCommand(
// Since we have full control over the invocation of JOM, let us
// make it quiet.
jomMakeOptions.push_back(this->MakeSilentFlag);
- cmAppend(jomMakeOptions, makeOptions);
+ cm::append(jomMakeOptions, makeOptions);
// JOM does parallel builds by default, the -j is only needed if a specific
// number is given
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 2273c00..c4bec23 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -66,7 +66,7 @@ cmGlobalNMakeMakefileGenerator::GenerateBuildCommand(
// Since we have full control over the invocation of nmake, let us
// make it quiet.
nmakeMakeOptions.push_back(this->MakeSilentFlag);
- cmAppend(nmakeMakeOptions, makeOptions);
+ cm::append(nmakeMakeOptions, makeOptions);
return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
makeProgram, projectName, projectDir, targetNames, config, fast,
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 11dd705..2a59708 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -9,6 +9,7 @@
#include <sstream>
#include <cm/memory>
+#include <cmext/algorithm>
#include <cmext/memory>
#include "cmsys/FStream.hxx"
@@ -1025,7 +1026,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
}
}
std::sort(outs.begin(), outs.end());
- cmAppend(outputs, outs);
+ cm::append(outputs, outs);
}
}
@@ -1035,7 +1036,7 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
{
cmNinjaOuts outs;
this->AppendTargetDependsClosure(target, outs, config, true);
- cmAppend(outputs, outs);
+ cm::append(outputs, outs);
}
void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
@@ -1585,7 +1586,7 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
<< config << "\")\n";
fout << " file(REMOVE_RECURSE\n";
for (std::string const& acf : it->second.AdditionalCleanFiles) {
- fout << " "
+ fout << " "
<< cmOutputConverter::EscapeForCMake(ConvertToNinjaPath(acf))
<< '\n';
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index fe8c3f4..f2595ea 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -8,9 +8,9 @@
#include <utility>
#include <cm/memory>
+#include <cmext/algorithm>
#include <cmext/memory>
-#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -289,7 +289,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
std::vector<std::string> lfiles;
for (const auto& localGen : this->LocalGenerators) {
// Get the list of files contributing to this generation step.
- cmAppend(lfiles, localGen->GetMakefile()->GetListFiles());
+ cm::append(lfiles, localGen->GetMakefile()->GetListFiles());
}
cmake* cm = this->GetCMakeInstance();
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 6e89fc4..ba54f98 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -146,7 +146,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
// project.
std::vector<std::string> listFiles;
for (const auto& gen : generators) {
- cmAppend(listFiles, gen->GetMakefile()->GetListFiles());
+ cm::append(listFiles, gen->GetMakefile()->GetListFiles());
}
// Add a custom prebuild target to run the VerifyGlobs script.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 37717f4..dcd9705 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -10,6 +10,7 @@
#include <sstream>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cmsys/RegularExpression.hxx"
@@ -577,7 +578,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
{
std::vector<std::string> lfiles;
for (auto gen : gens) {
- cmAppend(lfiles, gen->GetMakefile()->GetListFiles());
+ cm::append(lfiles, gen->GetMakefile()->GetListFiles());
}
// sort the array
@@ -1095,7 +1096,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
{
this->SetCurrentLocalGenerator(gen);
std::vector<cmGeneratorTarget*> gts;
- cmAppend(gts, this->CurrentLocalGenerator->GetGeneratorTargets());
+ cm::append(gts, this->CurrentLocalGenerator->GetGeneratorTargets());
std::sort(gts.begin(), gts.end(),
[this](cmGeneratorTarget const* l, cmGeneratorTarget const* r) {
return this->TargetOrderIndex[l] < this->TargetOrderIndex[r];
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 71326d2..b53319f 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -4,6 +4,8 @@
#include <iterator>
+#include <cmext/algorithm>
+
#include <string.h>
#include "cmsys/String.h"
@@ -173,7 +175,7 @@ void cmIDEOptions::AddDefines(std::string const& defines)
}
void cmIDEOptions::AddDefines(const std::vector<std::string>& defines)
{
- cmAppend(this->Defines, defines);
+ cm::append(this->Defines, defines);
}
std::vector<std::string> const& cmIDEOptions::GetDefines() const
@@ -195,7 +197,7 @@ void cmIDEOptions::AddIncludes(std::string const& includes)
}
void cmIDEOptions::AddIncludes(const std::vector<std::string>& includes)
{
- cmAppend(this->Includes, includes);
+ cm::append(this->Includes, includes);
}
std::vector<std::string> const& cmIDEOptions::GetIncludes() const
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 170aea1..b408f72 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -6,7 +6,8 @@
#include <set>
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
@@ -58,9 +59,9 @@ bool cmIncludeDirectoryCommand(std::vector<std::string> const& args,
GetIncludes(mf, *i, includes);
if (before) {
- cmAppend(beforeIncludes, includes);
+ cm::append(beforeIncludes, includes);
} else {
- cmAppend(afterIncludes, includes);
+ cm::append(afterIncludes, includes);
}
if (system) {
systemIncludes.insert(includes.begin(), includes.end());
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index eabe590..a65ae03 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -4,7 +4,6 @@
#include <utility>
-#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
@@ -12,17 +11,11 @@
cmInstalledFile::cmInstalledFile() = default;
-cmInstalledFile::~cmInstalledFile()
-{
- delete NameExpression;
-}
+cmInstalledFile::~cmInstalledFile() = default;
cmInstalledFile::Property::Property() = default;
-cmInstalledFile::Property::~Property()
-{
- cmDeleteAll(this->ValueExpressions);
-}
+cmInstalledFile::Property::~Property() = default;
void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
{
@@ -30,7 +23,7 @@ void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
cmGeneratorExpression ge(backtrace);
this->Name = name;
- this->NameExpression = ge.Parse(name).release();
+ this->NameExpression = ge.Parse(name);
}
std::string const& cmInstalledFile::GetName() const
@@ -63,7 +56,7 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf,
cmGeneratorExpression ge(backtrace);
Property& property = this->Properties[prop];
- property.ValueExpressions.push_back(ge.Parse(value).release());
+ property.ValueExpressions.push_back(ge.Parse(value));
}
bool cmInstalledFile::HasProperty(const std::string& prop) const
@@ -84,7 +77,7 @@ bool cmInstalledFile::GetProperty(const std::string& prop,
std::string output;
std::string separator;
- for (auto ve : property.ValueExpressions) {
+ for (const auto& ve : property.ValueExpressions) {
output += separator;
output += ve->GetInput();
separator = ";";
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index ee809ee..698151e 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -24,7 +24,7 @@ public:
using CompiledGeneratorExpressionPtrType =
std::unique_ptr<cmCompiledGeneratorExpression>;
- using ExpressionVectorType = std::vector<cmCompiledGeneratorExpression*>;
+ using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
struct Property
{
@@ -73,7 +73,7 @@ public:
private:
std::string Name;
- cmCompiledGeneratorExpression* NameExpression = nullptr;
+ CompiledGeneratorExpressionPtrType NameExpression;
PropertyMapType Properties;
};
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index b23ab43..5f86d85 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -14,7 +14,8 @@
#include <utility>
#include <vector>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
@@ -601,7 +602,7 @@ static Json::Value DumpTargetsList(
std::vector<cmGeneratorTarget*> targetList;
for (auto const& lgIt : generators) {
- cmAppend(targetList, lgIt->GetGeneratorTargets());
+ cm::append(targetList, lgIt->GetGeneratorTargets());
}
std::sort(targetList.begin(), targetList.end());
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 45eb113..1da6efe 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -16,6 +16,7 @@
#include <cm/memory>
#include <cm/string_view>
+#include <cmext/algorithm>
#include "cmsys/RegularExpression.hxx"
@@ -392,7 +393,7 @@ void cmLocalGenerator::ProcessEvaluationFiles(
return;
}
- cmAppend(generatedFiles, files);
+ cm::append(generatedFiles, files);
std::inplace_merge(generatedFiles.begin(),
generatedFiles.end() - files.size(),
generatedFiles.end());
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 29c169f..098fa5a 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -5,7 +5,8 @@
#include <algorithm>
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmGeneratorTarget.h"
#include "cmGhsMultiTargetGenerator.h"
#include "cmGlobalGenerator.h"
@@ -52,7 +53,7 @@ void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
void cmLocalGhsMultiGenerator::Generate()
{
std::vector<cmGeneratorTarget*> remaining;
- cmAppend(remaining, this->GetGeneratorTargets());
+ cm::append(remaining, this->GetGeneratorTargets());
for (auto& t : remaining) {
if (t) {
this->GenerateTargetsDepthFirst(t, remaining);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 2912604..f6a0e34 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -9,6 +9,7 @@
#include <utility>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
@@ -858,7 +859,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepends(
// Add a dependency on the rule file itself unless an option to skip
// it is specifically enabled by the user or project.
if (!this->Makefile->IsOn("CMAKE_SKIP_RULE_DEPENDENCY")) {
- cmAppend(depends, ruleFiles);
+ cm::append(depends, ruleFiles);
}
}
@@ -1031,7 +1032,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
this->CreateCDCommand(commands1, dir, relative);
// push back the custom commands
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
}
void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index d9c4ce0..6f456c6 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmLocalVisualStudio10Generator.h"
+#include <cmext/algorithm>
+
#include "cm_expat.h"
#include "cmAlgorithms.h"
@@ -103,7 +105,7 @@ void cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst(
void cmLocalVisualStudio10Generator::Generate()
{
std::vector<cmGeneratorTarget*> remaining;
- cmAppend(remaining, this->GetGeneratorTargets());
+ cm::append(remaining, this->GetGeneratorTargets());
for (auto& t : remaining) {
if (t) {
this->GenerateTargetsDepthFirst(t, remaining);
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index ba9947a..a35dc20 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -7,10 +7,10 @@
#include <cm/memory>
#include <cm/string_view>
+#include <cmext/algorithm>
#include "cm_static_string_view.hxx"
-#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -190,7 +190,7 @@ bool cmMacroCommand(std::vector<std::string> const& args,
// create a function blocker
{
auto fb = cm::make_unique<cmMacroFunctionBlocker>();
- cmAppend(fb->Args, args);
+ cm::append(fb->Args, args);
status.GetMakefile().AddFunctionBlocker(std::move(fb));
}
return true;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0ad482c..2caa266 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -15,6 +15,7 @@
#include <cm/iterator>
#include <cm/optional>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -2660,7 +2661,7 @@ const std::string& cmMakefile::GetSafeDefinition(const std::string& name) const
std::vector<std::string> cmMakefile::GetDefinitions() const
{
std::vector<std::string> res = this->StateSnapshot.ClosureKeys();
- cmAppend(res, this->GetState()->GetCacheEntryKeys());
+ cm::append(res, this->GetState()->GetCacheEntryKeys());
std::sort(res.begin(), res.end());
return res;
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index ff8682c..5c9608c 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -9,8 +9,8 @@
#include <vector>
#include <cm/memory>
+#include <cmext/algorithm>
-#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalUnixMakefileGenerator3.h"
@@ -263,7 +263,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
// Write the build rule.
@@ -630,7 +630,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
// Add a rule to create necessary symlinks for the library.
@@ -642,7 +642,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 872521c..e728b67 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -9,8 +9,8 @@
#include <vector>
#include <cm/memory>
+#include <cmext/algorithm>
-#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalUnixMakefileGenerator3.h"
@@ -397,7 +397,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
// Compute the list of outputs.
@@ -571,7 +571,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
}
@@ -907,7 +907,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
// Add a rule to create necessary symlinks for the library.
@@ -921,7 +921,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
this->LocalGenerator->CreateCDCommand(
commands1, this->Makefile->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, commands1);
+ cm::append(commands, commands1);
commands1.clear();
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 436503b..4979da5 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -8,7 +8,8 @@
#include <sstream>
#include <utility>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmComputeLinkInformation.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
@@ -225,9 +226,10 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
std::vector<cmCustomCommand> buildEventCommands =
this->GeneratorTarget->GetPreBuildCommands();
- cmAppend(buildEventCommands, this->GeneratorTarget->GetPreLinkCommands());
- cmAppend(buildEventCommands,
- this->GeneratorTarget->GetPostBuildCommands());
+ cm::append(buildEventCommands,
+ this->GeneratorTarget->GetPreLinkCommands());
+ cm::append(buildEventCommands,
+ this->GeneratorTarget->GetPostBuildCommands());
for (const auto& be : buildEventCommands) {
cmCustomCommandGenerator beg(be, this->GetConfigName(),
@@ -841,7 +843,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
this->LocalGenerator->CreateCDCommand(
compileCommands, this->LocalGenerator->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, compileCommands);
+ cm::append(commands, compileCommands);
}
// Check for extra outputs created by the compilation.
@@ -900,7 +902,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
preprocessCommands,
this->LocalGenerator->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, preprocessCommands);
+ cm::append(commands, preprocessCommands);
} else {
std::string cmd =
cmStrCat("$(CMAKE_COMMAND) -E cmake_unimplemented_variable ",
@@ -944,7 +946,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
this->LocalGenerator->CreateCDCommand(
assemblyCommands, this->LocalGenerator->GetCurrentBinaryDirectory(),
this->LocalGenerator->GetBinaryDirectory());
- cmAppend(commands, assemblyCommands);
+ cm::append(commands, assemblyCommands);
} else {
std::string cmd =
cmStrCat("$(CMAKE_COMMAND) -E cmake_unimplemented_variable ",
@@ -1192,7 +1194,7 @@ void cmMakefileTargetGenerator::DriveCustomCommands(
if (cmCustomCommand* cc = source->GetCustomCommand()) {
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
this->LocalGenerator);
- cmAppend(depends, ccg.GetOutputs());
+ cm::append(depends, ccg.GetOutputs());
}
}
}
@@ -1429,7 +1431,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
}
// Make sure the extra files are built.
- cmAppend(depends, this->ExtraFiles);
+ cm::append(depends, this->ExtraFiles);
}
// Write the driver rule.
@@ -1451,7 +1453,7 @@ void cmMakefileTargetGenerator::AppendTargetDepends(
const std::string& cfg = this->GetConfigName();
if (cmComputeLinkInformation* cli =
this->GeneratorTarget->GetLinkInformation(cfg)) {
- cmAppend(depends, cli->GetDepends());
+ cm::append(depends, cli->GetDepends());
}
}
@@ -1467,7 +1469,7 @@ void cmMakefileTargetGenerator::AppendObjectDepends(
}
// Add dependencies on the external object files.
- cmAppend(depends, this->ExternalObjects);
+ cm::append(depends, this->ExternalObjects);
// Add a dependency on the rule file itself.
this->LocalGenerator->AppendRuleDepend(depends,
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index ee1163a..3f1dbe8 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -10,11 +10,11 @@
#include <utility>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cm_jsoncpp_value.h"
#include "cm_jsoncpp_writer.h"
-#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
@@ -870,7 +870,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
DependOnTargetOrdering);
// Add order-only dependencies on other files associated with the target.
- cmAppend(orderOnlyDeps, this->Configs[config].ExtraFiles);
+ cm::append(orderOnlyDeps, this->Configs[config].ExtraFiles);
// Add order-only dependencies on custom command outputs.
for (cmCustomCommand const* cc : this->Configs[config].CustomCommands) {
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 073222c..0369af0 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -8,7 +8,9 @@
#include <sstream>
#include <vector>
-#include "cmAlgorithms.h"
+#include <cm/memory>
+#include <cmext/algorithm>
+
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmMessageType.h"
@@ -248,11 +250,7 @@ cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg,
this->Computed = false;
}
-cmOrderDirectories::~cmOrderDirectories()
-{
- cmDeleteAll(this->ConstraintEntries);
- cmDeleteAll(this->ImplicitDirEntries);
-}
+cmOrderDirectories::~cmOrderDirectories() = default;
std::vector<std::string> const& cmOrderDirectories::GetOrderedDirectories()
{
@@ -286,14 +284,16 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ cm::make_unique<cmOrderDirectoriesConstraintSOName>(this, fullPath,
+ soname));
return;
}
}
// Construct the runtime information entry for this library.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ cm::make_unique<cmOrderDirectoriesConstraintSOName>(this, fullPath,
+ soname));
} else {
// This can happen if the same library is linked multiple times.
// In that case the runtime information check need be done only
@@ -314,27 +314,28 @@ void cmOrderDirectories::AddLinkLibrary(std::string const& fullPath)
std::string dir = cmSystemTools::GetFilenamePath(fullPath);
if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintLibrary(this, fullPath));
+ cm::make_unique<cmOrderDirectoriesConstraintLibrary>(this,
+ fullPath));
return;
}
}
// Construct the link library entry.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintLibrary(this, fullPath));
+ cm::make_unique<cmOrderDirectoriesConstraintLibrary>(this, fullPath));
}
}
void cmOrderDirectories::AddUserDirectories(
std::vector<std::string> const& extra)
{
- cmAppend(this->UserDirectories, extra);
+ cm::append(this->UserDirectories, extra);
}
void cmOrderDirectories::AddLanguageDirectories(
std::vector<std::string> const& dirs)
{
- cmAppend(this->LanguageDirectories, dirs);
+ cm::append(this->LanguageDirectories, dirs);
}
void cmOrderDirectories::SetImplicitDirectories(
@@ -369,7 +370,7 @@ void cmOrderDirectories::CollectOriginalDirectories()
this->AddOriginalDirectories(this->UserDirectories);
// Add directories containing constraints.
- for (cmOrderDirectoriesConstraint* entry : this->ConstraintEntries) {
+ for (const auto& entry : this->ConstraintEntries) {
entry->AddDirectory();
}
@@ -454,7 +455,7 @@ void cmOrderDirectories::FindImplicitConflicts()
// Check for items in implicit link directories that have conflicts
// in the explicit directories.
std::ostringstream conflicts;
- for (cmOrderDirectoriesConstraint* entry : this->ImplicitDirEntries) {
+ for (const auto& entry : this->ImplicitDirEntries) {
entry->FindImplicitConflicts(conflicts);
}
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index 23c5145..8ce53e0 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -46,8 +47,9 @@ private:
std::vector<std::string> OrderedDirectories;
- std::vector<cmOrderDirectoriesConstraint*> ConstraintEntries;
- std::vector<cmOrderDirectoriesConstraint*> ImplicitDirEntries;
+ std::vector<std::unique_ptr<cmOrderDirectoriesConstraint>> ConstraintEntries;
+ std::vector<std::unique_ptr<cmOrderDirectoriesConstraint>>
+ ImplicitDirEntries;
std::vector<std::string> UserDirectories;
std::vector<std::string> LanguageDirectories;
cmsys::RegularExpression RemoveLibraryExtension;
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index eb7c900..d5891c4 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -8,6 +8,8 @@
#include <sstream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -67,7 +69,7 @@ void MergeOptions(std::vector<std::string>& baseOpts,
}
}
// Append options
- cmAppend(baseOpts, extraOpts);
+ cm::append(baseOpts, extraOpts);
}
// - Class definitions
@@ -328,7 +330,7 @@ bool cmQtAutoGen::RccLister::list(std::string const& qrcFile,
{
std::vector<std::string> cmd;
cmd.emplace_back(this->RccExcutable_);
- cmAppend(cmd, this->ListOptions_);
+ cm::append(cmd, this->ListOptions_);
cmd.emplace_back(cmSystemTools::GetFilenameName(qrcFile));
// Log command
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 921e2b2..ab47f3f 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -763,7 +763,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// Register files that will be scanned by moc or uic
if (this->MocOrUicEnabled()) {
- if (cm->IsHeaderExtension(extLower)) {
+ // FIXME: Add a policy to include .hh files.
+ if (cm->IsHeaderExtension(extLower) && extLower != "hh") {
addMUFile(makeMUFile(sf, fullPath, true), true);
} else if (cm->IsSourceExtension(extLower)) {
addMUFile(makeMUFile(sf, fullPath, true), false);
@@ -875,7 +876,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
std::string const& extLower =
cmSystemTools::LowerCase(sf->GetExtension());
- if (cm->IsHeaderExtension(extLower)) {
+ // FIXME: Add a policy to include .hh files.
+ if (cm->IsHeaderExtension(extLower) && extLower != "hh") {
if (!cmContains(this->AutogenTarget.Headers, sf)) {
auto muf = makeMUFile(sf, fullPath, false);
if (muf->SkipMoc || muf->SkipUic) {
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index f8b8981..fa5129d 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -16,13 +16,13 @@
#include <cm/memory>
#include <cm/string_view>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
#include "cm_jsoncpp_value.h"
-#include "cmAlgorithms.h"
#include "cmCryptoHash.h"
#include "cmFileTime.h"
#include "cmGeneratedFileStream.h"
@@ -808,9 +808,9 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
// Compose command
std::vector<std::string> cmd = MocConst().PredefsCmd;
// Add definitions
- cmAppend(cmd, MocConst().OptionsDefinitions);
+ cm::append(cmd, MocConst().OptionsDefinitions);
// Add includes
- cmAppend(cmd, MocConst().OptionsIncludes);
+ cm::append(cmd, MocConst().OptionsIncludes);
// Execute command
if (!RunProcess(GenT::MOC, result, cmd, reason.get())) {
LogCommandError(GenT::MOC,
@@ -1916,9 +1916,9 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
MocConst().OptionsExtra.size() + 16);
cmd.push_back(MocConst().Executable);
// Add definitions
- cmAppend(cmd, MocConst().OptionsDefinitions);
+ cm::append(cmd, MocConst().OptionsDefinitions);
// Add includes
- cmAppend(cmd, MocConst().OptionsIncludes);
+ cm::append(cmd, MocConst().OptionsIncludes);
// Add predefs include
if (!MocConst().PredefsFileAbs.empty()) {
cmd.emplace_back("--include");
@@ -1946,7 +1946,7 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
}
}
// Add extra options
- cmAppend(cmd, MocConst().OptionsExtra);
+ cm::append(cmd, MocConst().OptionsExtra);
// Add output file
cmd.emplace_back("-o");
cmd.push_back(outputFile);
@@ -1994,7 +1994,7 @@ void cmQtAutoMocUicT::JobCompileUicT::Process()
UicMergeOptions(allOpts, optionIt->second.Options,
(BaseConst().QtVersionMajor == 5));
}
- cmAppend(cmd, allOpts);
+ cm::append(cmd, allOpts);
}
cmd.emplace_back("-o");
cmd.emplace_back(outputFile);
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx
index 3af81ad..08eb4b5 100644
--- a/Source/cmQtAutoRcc.cxx
+++ b/Source/cmQtAutoRcc.cxx
@@ -6,7 +6,8 @@
#include <string>
#include <vector>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmCryptoHash.h"
#include "cmDuration.h"
#include "cmFileLock.h"
@@ -405,7 +406,7 @@ bool cmQtAutoRccT::GenerateRcc()
// Compose rcc command
std::vector<std::string> cmd;
cmd.push_back(RccExecutable_);
- cmAppend(cmd, Options_);
+ cm::append(cmd, Options_);
cmd.emplace_back("-o");
cmd.push_back(RccFileOutput_);
cmd.push_back(QrcFile_);
diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx
index 0174f1f..cd0fa40 100644
--- a/Source/cmSetTargetPropertiesCommand.cxx
+++ b/Source/cmSetTargetPropertiesCommand.cxx
@@ -4,7 +4,8 @@
#include <iterator>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
@@ -33,7 +34,7 @@ bool cmSetTargetPropertiesCommand(std::vector<std::string> const& args,
status.SetError("called with incorrect number of arguments.");
return false;
}
- cmAppend(propertyPairs, j, args.end());
+ cm::append(propertyPairs, j, args.end());
break;
}
numFiles++;
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index de61eda..2e7aeca 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -4,7 +4,8 @@
#include <iterator>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
@@ -36,7 +37,7 @@ bool cmSetTestsPropertiesCommand(std::vector<std::string> const& args,
status.SetError("called with incorrect number of arguments.");
return false;
}
- cmAppend(propertyPairs, j, args.end());
+ cm::append(propertyPairs, j, args.end());
break;
}
numFiles++;
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 1262f53..97fdbbe 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -8,6 +8,7 @@
#include <vector>
#include <cm/iterator>
+#include <cmext/algorithm>
#include "cmAlgorithms.h"
#include "cmProperty.h"
@@ -607,7 +608,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
}
if (prop == "VARIABLES") {
std::vector<std::string> res = this->Snapshot_.ClosureKeys();
- cmAppend(res, this->Snapshot_.State->GetCacheEntryKeys());
+ cm::append(res, this->Snapshot_.State->GetCacheEntryKeys());
std::sort(res.begin(), res.end());
output = cmJoin(res, ";");
return output.c_str();
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 17d32c6..9127c50 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2,9 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSystemTools.h"
+#include <cmext/algorithm>
+
#include "cm_uv.h"
-#include "cmAlgorithms.h"
#include "cmDuration.h"
#include "cmProcessOutput.h"
#include "cmRange.h"
@@ -360,7 +361,7 @@ std::vector<std::string> cmSystemTools::HandleResponseFile(
#else
cmSystemTools::ParseUnixCommandLine(line.c_str(), args2);
#endif
- cmAppend(arg_full, args2);
+ cm::append(arg_full, args2);
}
} else {
arg_full.push_back(arg);
@@ -585,7 +586,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
cmSystemTools::Stdout(strdata);
}
if (captureStdOut) {
- cmAppend(tempStdOut, data, data + length);
+ cm::append(tempStdOut, data, data + length);
}
} else if (pipe == cmsysProcess_Pipe_STDERR) {
if (outputflag != OUTPUT_NONE) {
@@ -593,7 +594,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
cmSystemTools::Stderr(strdata);
}
if (captureStdErr) {
- cmAppend(tempStdErr, data, data + length);
+ cm::append(tempStdErr, data, data + length);
}
}
}
@@ -1712,26 +1713,26 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
processOutput.DecodeText(data, length, strdata, 1);
// Append to the stdout buffer.
std::vector<char>::size_type size = out.size();
- cmAppend(out, strdata);
+ cm::append(out, strdata);
outiter = out.begin() + size;
} else if (pipe == cmsysProcess_Pipe_STDERR) {
processOutput.DecodeText(data, length, strdata, 2);
// Append to the stderr buffer.
std::vector<char>::size_type size = err.size();
- cmAppend(err, strdata);
+ cm::append(err, strdata);
erriter = err.begin() + size;
} else if (pipe == cmsysProcess_Pipe_None) {
// Both stdout and stderr pipes have broken. Return leftover data.
processOutput.DecodeText(std::string(), strdata, 1);
if (!strdata.empty()) {
std::vector<char>::size_type size = out.size();
- cmAppend(out, strdata);
+ cm::append(out, strdata);
outiter = out.begin() + size;
}
processOutput.DecodeText(std::string(), strdata, 2);
if (!strdata.empty()) {
std::vector<char>::size_type size = err.size();
- cmAppend(err, strdata);
+ cm::append(err, strdata);
erriter = err.begin() + size;
}
if (!out.empty()) {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1577839..d2693b8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -12,6 +12,7 @@
#include <unordered_set>
#include <cm/memory>
+#include <cmext/algorithm>
#include "cmsys/RegularExpression.hxx"
@@ -439,30 +440,30 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (!this->IsImported()) {
// Initialize the INCLUDE_DIRECTORIES property based on the current value
// of the same directory property:
- cmAppend(impl->IncludeDirectoriesEntries,
- impl->Makefile->GetIncludeDirectoriesEntries());
- cmAppend(impl->IncludeDirectoriesBacktraces,
- impl->Makefile->GetIncludeDirectoriesBacktraces());
+ cm::append(impl->IncludeDirectoriesEntries,
+ impl->Makefile->GetIncludeDirectoriesEntries());
+ cm::append(impl->IncludeDirectoriesBacktraces,
+ impl->Makefile->GetIncludeDirectoriesBacktraces());
{
auto const& sysInc = impl->Makefile->GetSystemIncludeDirectories();
impl->SystemIncludeDirectories.insert(sysInc.begin(), sysInc.end());
}
- cmAppend(impl->CompileOptionsEntries,
- impl->Makefile->GetCompileOptionsEntries());
- cmAppend(impl->CompileOptionsBacktraces,
- impl->Makefile->GetCompileOptionsBacktraces());
+ cm::append(impl->CompileOptionsEntries,
+ impl->Makefile->GetCompileOptionsEntries());
+ cm::append(impl->CompileOptionsBacktraces,
+ impl->Makefile->GetCompileOptionsBacktraces());
- cmAppend(impl->LinkOptionsEntries,
- impl->Makefile->GetLinkOptionsEntries());
- cmAppend(impl->LinkOptionsBacktraces,
- impl->Makefile->GetLinkOptionsBacktraces());
+ cm::append(impl->LinkOptionsEntries,
+ impl->Makefile->GetLinkOptionsEntries());
+ cm::append(impl->LinkOptionsBacktraces,
+ impl->Makefile->GetLinkOptionsBacktraces());
- cmAppend(impl->LinkDirectoriesEntries,
- impl->Makefile->GetLinkDirectoriesEntries());
- cmAppend(impl->LinkDirectoriesBacktraces,
- impl->Makefile->GetLinkDirectoriesBacktraces());
+ cm::append(impl->LinkDirectoriesEntries,
+ impl->Makefile->GetLinkDirectoriesEntries());
+ cm::append(impl->LinkDirectoriesBacktraces,
+ impl->Makefile->GetLinkDirectoriesBacktraces());
}
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 3642a0f..6b85937 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -8,6 +8,8 @@
# include <cm/iterator>
#endif
+#include <cmext/algorithm>
+
#include "cm_sys_stat.h"
#include "cmAlgorithms.h"
@@ -1052,7 +1054,7 @@ void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
std::vector<std::string> names = gen->GetGeneratorNames();
if (includeNamesWithPlatform) {
- cmAppend(names, gen->GetGeneratorNamesWithPlatform());
+ cm::append(names, gen->GetGeneratorNamesWithPlatform());
}
for (std::string const& name : names) {
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 253191a..eafcf6b 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -1,7 +1,16 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmAlgorithms.h"
+#include <cassert>
+#include <cctype>
+#include <climits>
+#include <cstring>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include <cmext/algorithm>
+
#include "cmDocumentationEntry.h" // IWYU pragma: keep
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
@@ -24,14 +33,6 @@
# include "cmsys/ConsoleBuf.hxx"
#endif
-#include <cassert>
-#include <cctype>
-#include <climits>
-#include <cstring>
-#include <iostream>
-#include <string>
-#include <vector>
-
namespace {
#ifndef CMAKE_BOOTSTRAP
const char* cmDocumentationName[][2] = {
@@ -101,7 +102,7 @@ int do_command(int ac, char const* const* av)
std::vector<std::string> args;
args.reserve(ac - 1);
args.emplace_back(av[0]);
- cmAppend(args, av + 2, av + ac);
+ cm::append(args, av + 2, av + ac);
return cmcmd::ExecuteCMakeCommand(args);
}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 9f4463c..9a07aef 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmcmd.h"
+#include <cmext/algorithm>
+
#include "cmAlgorithms.h"
#include "cmDuration.h"
#include "cmGlobalGenerator.h"
@@ -198,7 +200,7 @@ static int HandleIWYU(const std::string& runCmd,
// Construct the iwyu command line by taking what was given
// and adding all the arguments we give to the compiler.
std::vector<std::string> iwyu_cmd = cmExpandedList(runCmd, true);
- cmAppend(iwyu_cmd, orig_cmd.begin() + 1, orig_cmd.end());
+ cm::append(iwyu_cmd, orig_cmd.begin() + 1, orig_cmd.end());
// Run the iwyu command line. Capture its stderr and hide its stdout.
// Ignore its return code because the tool always returns non-zero.
std::string stdErr;
@@ -229,7 +231,7 @@ static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
std::vector<std::string> tidy_cmd = cmExpandedList(runCmd, true);
tidy_cmd.push_back(sourceFile);
tidy_cmd.emplace_back("--");
- cmAppend(tidy_cmd, orig_cmd);
+ cm::append(tidy_cmd, orig_cmd);
// Run the tidy command line. Capture its stdout and hide its stderr.
std::string stdOut;
@@ -2027,7 +2029,7 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
if (this->LinkGeneratesManifest) {
mtCommand.push_back(this->LinkerManifestFile);
}
- cmAppend(mtCommand, this->UserManifests);
+ cm::append(mtCommand, this->UserManifests);
mtCommand.push_back(out);
if (notify) {
// Add an undocumented option that enables a special return