modernize: manage cmCommand instances using unique_ptr.

This commit is contained in:
Marc Chevrier
2019-07-04 18:14:22 +02:00
parent d9b2c7dae2
commit 1591f138f1
136 changed files with 1014 additions and 399 deletions

View File

@@ -8,9 +8,11 @@
#include <string>
#include <vector>
#include "cm_memory.hxx"
#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
cmCommand* Clone() override { return new cmTargetLinkOptionsCommand; }
std::unique_ptr<cmCommand> Clone() override
{
return cm::make_unique<cmTargetLinkOptionsCommand>();
}
/**
* This is called when the command is first encountered in