Merge branch 'include-command-whitespace' into policy-CMP0017
This commit is contained in:
commit
65a0a2a5f9
|
@ -26,10 +26,10 @@ bool cmIncludeCommand
|
||||||
bool noPolicyScope = false;
|
bool noPolicyScope = false;
|
||||||
std::string fname = args[0];
|
std::string fname = args[0];
|
||||||
std::string resultVarName;
|
std::string resultVarName;
|
||||||
|
|
||||||
for (unsigned int i=1; i<args.size(); i++)
|
for (unsigned int i=1; i<args.size(); i++)
|
||||||
{
|
{
|
||||||
if (args[i] == "OPTIONAL")
|
if (args[i] == "OPTIONAL")
|
||||||
{
|
{
|
||||||
if (optional)
|
if (optional)
|
||||||
{
|
{
|
||||||
|
@ -60,10 +60,10 @@ bool cmIncludeCommand
|
||||||
{
|
{
|
||||||
noPolicyScope = true;
|
noPolicyScope = true;
|
||||||
}
|
}
|
||||||
else if(i > 1) // compat.: in previous cmake versions the second
|
else if(i > 1) // compat.: in previous cmake versions the second
|
||||||
// parameter was ignore if it wasn't "OPTIONAL"
|
// parameter was ignore if it wasn't "OPTIONAL"
|
||||||
{
|
{
|
||||||
std::string errorText = "called with invalid argument: ";
|
std::string errorText = "called with invalid argument: ";
|
||||||
errorText += args[i];
|
errorText += args[i];
|
||||||
this->SetError(errorText.c_str());
|
this->SetError(errorText.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -82,15 +82,15 @@ bool cmIncludeCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string fullFilePath;
|
std::string fullFilePath;
|
||||||
bool readit =
|
bool readit =
|
||||||
this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
|
this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
|
||||||
fname.c_str(), &fullFilePath,
|
fname.c_str(), &fullFilePath,
|
||||||
noPolicyScope);
|
noPolicyScope);
|
||||||
|
|
||||||
// add the location of the included file if a result variable was given
|
// add the location of the included file if a result variable was given
|
||||||
if (resultVarName.size())
|
if (resultVarName.size())
|
||||||
{
|
{
|
||||||
this->Makefile->AddDefinition(resultVarName.c_str(),
|
this->Makefile->AddDefinition(resultVarName.c_str(),
|
||||||
readit?fullFilePath.c_str():"NOTFOUND");
|
readit?fullFilePath.c_str():"NOTFOUND");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "cmCommand.h"
|
#include "cmCommand.h"
|
||||||
|
|
||||||
/** \class cmIncludeCommand
|
/** \class cmIncludeCommand
|
||||||
* \brief
|
* \brief
|
||||||
*
|
*
|
||||||
* cmIncludeCommand defines a list of distant
|
* cmIncludeCommand defines a list of distant
|
||||||
* files that can be "included" in the current list file.
|
* files that can be "included" in the current list file.
|
||||||
|
@ -28,7 +28,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* This is a virtual constructor for the command.
|
* This is a virtual constructor for the command.
|
||||||
*/
|
*/
|
||||||
virtual cmCommand* Clone()
|
virtual cmCommand* Clone()
|
||||||
{
|
{
|
||||||
return new cmIncludeCommand;
|
return new cmIncludeCommand;
|
||||||
}
|
}
|
||||||
|
@ -49,15 +49,15 @@ public:
|
||||||
* The name of the command as specified in CMakeList.txt.
|
* The name of the command as specified in CMakeList.txt.
|
||||||
*/
|
*/
|
||||||
virtual const char* GetName() {return "include";}
|
virtual const char* GetName() {return "include";}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Succinct documentation.
|
* Succinct documentation.
|
||||||
*/
|
*/
|
||||||
virtual const char* GetTerseDocumentation()
|
virtual const char* GetTerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Read CMake listfile code from the given file.";
|
return "Read CMake listfile code from the given file.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* More documentation.
|
* More documentation.
|
||||||
*/
|
*/
|
||||||
|
@ -79,7 +79,7 @@ public:
|
||||||
"NO_POLICY_SCOPE option."
|
"NO_POLICY_SCOPE option."
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTypeMacro(cmIncludeCommand, cmCommand);
|
cmTypeMacro(cmIncludeCommand, cmCommand);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue