BUG: Added FILES mode to INSTALL_PROGRAMS command to make the single argument case unambiguous.
This commit is contained in:
parent
717927d6d2
commit
b636a0f20a
|
@ -46,12 +46,23 @@ void cmInstallProgramsCommand::FinalPass()
|
||||||
std::vector<std::string>& targetSourceLists =
|
std::vector<std::string>& targetSourceLists =
|
||||||
m_Makefile->GetTargets()[m_TargetName].GetSourceLists();
|
m_Makefile->GetTargets()[m_TargetName].GetSourceLists();
|
||||||
|
|
||||||
|
bool files_mode = false;
|
||||||
|
if(!m_FinalArgs.empty() && m_FinalArgs[0] == "FILES")
|
||||||
|
{
|
||||||
|
files_mode = true;
|
||||||
|
}
|
||||||
|
|
||||||
// two different options
|
// two different options
|
||||||
if (m_FinalArgs.size() > 1)
|
if (m_FinalArgs.size() > 1 || files_mode)
|
||||||
{
|
{
|
||||||
// for each argument, get the programs
|
// for each argument, get the programs
|
||||||
for (std::vector<std::string>::iterator s = m_FinalArgs.begin();
|
std::vector<std::string>::iterator s = m_FinalArgs.begin();
|
||||||
s != m_FinalArgs.end(); ++s)
|
if(files_mode)
|
||||||
|
{
|
||||||
|
// Skip the FILES argument in files mode.
|
||||||
|
++s;
|
||||||
|
}
|
||||||
|
for(;s != m_FinalArgs.end(); ++s)
|
||||||
{
|
{
|
||||||
// add to the result
|
// add to the result
|
||||||
targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
|
targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
|
||||||
|
|
|
@ -69,8 +69,11 @@ public:
|
||||||
virtual const char* GetFullDocumentation()
|
virtual const char* GetFullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
" INSTALL_PROGRAMS(<dir> file file ...)\n"
|
" INSTALL_PROGRAMS(<dir> file1 file2 [file3 ...])\n"
|
||||||
"Create rules to install the listed programs into the given directory.\n"
|
" INSTALL_PROGRAMS(<dir> FILES file1 [file2 ...])\n"
|
||||||
|
"Create rules to install the listed programs into the given directory. "
|
||||||
|
"Use the FILES argument to guarantee that the file list version of "
|
||||||
|
"the command will be used even when there is only one argument.\n"
|
||||||
" INSTALL_PROGRAMS(<dir> regexp)\n"
|
" INSTALL_PROGRAMS(<dir> regexp)\n"
|
||||||
"In the second form any program in the current source directory that "
|
"In the second form any program in the current source directory that "
|
||||||
"matches the regular expression will be installed.\n"
|
"matches the regular expression will be installed.\n"
|
||||||
|
|
Loading…
Reference in New Issue