Merge topic 'install-command-cleanup'
982b5d9
cmInstallCommand: Fix line length for stylea64b618
cmInstallCommand: Remove duplicated sentence from docs01ddef8
cmInstallCommand: Fix indentation error
This commit is contained in:
commit
cef75ca909
|
@ -350,33 +350,33 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
||||||
targetIt!=targetList.GetVector().end();
|
targetIt!=targetList.GetVector().end();
|
||||||
++targetIt)
|
++targetIt)
|
||||||
{
|
{
|
||||||
// Lookup this target in the current directory.
|
// Lookup this target in the current directory.
|
||||||
if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str()))
|
if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str()))
|
||||||
|
{
|
||||||
|
// Found the target. Check its type.
|
||||||
|
if(target->GetType() != cmTarget::EXECUTABLE &&
|
||||||
|
target->GetType() != cmTarget::STATIC_LIBRARY &&
|
||||||
|
target->GetType() != cmTarget::SHARED_LIBRARY &&
|
||||||
|
target->GetType() != cmTarget::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
// Found the target. Check its type.
|
|
||||||
if(target->GetType() != cmTarget::EXECUTABLE &&
|
|
||||||
target->GetType() != cmTarget::STATIC_LIBRARY &&
|
|
||||||
target->GetType() != cmTarget::SHARED_LIBRARY &&
|
|
||||||
target->GetType() != cmTarget::MODULE_LIBRARY)
|
|
||||||
{
|
|
||||||
cmOStringStream e;
|
|
||||||
e << "TARGETS given target \"" << (*targetIt)
|
|
||||||
<< "\" which is not an executable, library, or module.";
|
|
||||||
this->SetError(e.str().c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Store the target in the list to be installed.
|
|
||||||
targets.push_back(target);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Did not find the target.
|
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
e << "TARGETS given target \"" << (*targetIt)
|
e << "TARGETS given target \"" << (*targetIt)
|
||||||
<< "\" which does not exist in this directory.";
|
<< "\" which is not an executable, library, or module.";
|
||||||
this->SetError(e.str().c_str());
|
this->SetError(e.str().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Store the target in the list to be installed.
|
||||||
|
targets.push_back(target);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Did not find the target.
|
||||||
|
cmOStringStream e;
|
||||||
|
e << "TARGETS given target \"" << (*targetIt)
|
||||||
|
<< "\" which does not exist in this directory.";
|
||||||
|
this->SetError(e.str().c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of whether we will be performing an installation of
|
// Keep track of whether we will be performing an installation of
|
||||||
|
@ -602,99 +602,99 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// These well-known sets of files are installed *automatically* for FRAMEWORK
|
// These well-known sets of files are installed *automatically* for
|
||||||
// SHARED library targets on the Mac as part of installing the FRAMEWORK.
|
// FRAMEWORK SHARED library targets on the Mac as part of installing the
|
||||||
// For other target types or on other platforms, they are not installed
|
// FRAMEWORK. For other target types or on other platforms, they are not
|
||||||
// automatically and so we need to create install files generators for them.
|
// installed automatically and so we need to create install files
|
||||||
//
|
// generators for them.
|
||||||
bool createInstallGeneratorsForTargetFileSets = true;
|
bool createInstallGeneratorsForTargetFileSets = true;
|
||||||
|
|
||||||
if(target.IsFrameworkOnApple())
|
if(target.IsFrameworkOnApple())
|
||||||
{
|
|
||||||
createInstallGeneratorsForTargetFileSets = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(createInstallGeneratorsForTargetFileSets && !namelinkOnly)
|
|
||||||
{
|
|
||||||
const char* files = target.GetProperty("PRIVATE_HEADER");
|
|
||||||
if ((files) && (*files))
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> relFiles;
|
createInstallGeneratorsForTargetFileSets = false;
|
||||||
cmSystemTools::ExpandListArgument(files, relFiles);
|
|
||||||
std::vector<std::string> absFiles;
|
|
||||||
if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the files install generator.
|
|
||||||
if (!privateHeaderArgs.GetDestination().empty())
|
|
||||||
{
|
|
||||||
privateHeaderGenerator = CreateInstallFilesGenerator(absFiles,
|
|
||||||
privateHeaderArgs, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmOStringStream e;
|
|
||||||
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
|
||||||
<< "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
|
|
||||||
cmSystemTools::Message(e.str().c_str(), "Warning");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
files = target.GetProperty("PUBLIC_HEADER");
|
if(createInstallGeneratorsForTargetFileSets && !namelinkOnly)
|
||||||
if ((files) && (*files))
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> relFiles;
|
const char* files = target.GetProperty("PRIVATE_HEADER");
|
||||||
cmSystemTools::ExpandListArgument(files, relFiles);
|
if ((files) && (*files))
|
||||||
std::vector<std::string> absFiles;
|
|
||||||
if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles))
|
|
||||||
{
|
{
|
||||||
return false;
|
std::vector<std::string> relFiles;
|
||||||
|
cmSystemTools::ExpandListArgument(files, relFiles);
|
||||||
|
std::vector<std::string> absFiles;
|
||||||
|
if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the files install generator.
|
||||||
|
if (!privateHeaderArgs.GetDestination().empty())
|
||||||
|
{
|
||||||
|
privateHeaderGenerator =
|
||||||
|
CreateInstallFilesGenerator(absFiles, privateHeaderArgs, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmOStringStream e;
|
||||||
|
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
||||||
|
<< "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
|
||||||
|
cmSystemTools::Message(e.str().c_str(), "Warning");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the files install generator.
|
files = target.GetProperty("PUBLIC_HEADER");
|
||||||
if (!publicHeaderArgs.GetDestination().empty())
|
if ((files) && (*files))
|
||||||
{
|
{
|
||||||
publicHeaderGenerator = CreateInstallFilesGenerator(absFiles,
|
std::vector<std::string> relFiles;
|
||||||
publicHeaderArgs, false);
|
cmSystemTools::ExpandListArgument(files, relFiles);
|
||||||
|
std::vector<std::string> absFiles;
|
||||||
|
if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the files install generator.
|
||||||
|
if (!publicHeaderArgs.GetDestination().empty())
|
||||||
|
{
|
||||||
|
publicHeaderGenerator =
|
||||||
|
CreateInstallFilesGenerator(absFiles, publicHeaderArgs, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmOStringStream e;
|
||||||
|
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
||||||
|
<< "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
|
||||||
|
cmSystemTools::Message(e.str().c_str(), "Warning");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
files = target.GetProperty("RESOURCE");
|
||||||
|
if ((files) && (*files))
|
||||||
{
|
{
|
||||||
cmOStringStream e;
|
std::vector<std::string> relFiles;
|
||||||
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
cmSystemTools::ExpandListArgument(files, relFiles);
|
||||||
<< "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
|
std::vector<std::string> absFiles;
|
||||||
cmSystemTools::Message(e.str().c_str(), "Warning");
|
if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the files install generator.
|
||||||
|
if (!resourceArgs.GetDestination().empty())
|
||||||
|
{
|
||||||
|
resourceGenerator = CreateInstallFilesGenerator(absFiles,
|
||||||
|
resourceArgs, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmOStringStream e;
|
||||||
|
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
||||||
|
<< "RESOURCE files but no RESOURCE DESTINATION.";
|
||||||
|
cmSystemTools::Message(e.str().c_str(), "Warning");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
files = target.GetProperty("RESOURCE");
|
|
||||||
if ((files) && (*files))
|
|
||||||
{
|
|
||||||
std::vector<std::string> relFiles;
|
|
||||||
cmSystemTools::ExpandListArgument(files, relFiles);
|
|
||||||
std::vector<std::string> absFiles;
|
|
||||||
if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the files install generator.
|
|
||||||
if (!resourceArgs.GetDestination().empty())
|
|
||||||
{
|
|
||||||
resourceGenerator = CreateInstallFilesGenerator(absFiles,
|
|
||||||
resourceArgs, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmOStringStream e;
|
|
||||||
e << "INSTALL TARGETS - target " << target.GetName() << " has "
|
|
||||||
<< "RESOURCE files but no RESOURCE DESTINATION.";
|
|
||||||
cmSystemTools::Message(e.str().c_str(), "Warning");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keep track of whether we're installing anything in each category
|
// Keep track of whether we're installing anything in each category
|
||||||
installsArchive = installsArchive || archiveGenerator != 0;
|
installsArchive = installsArchive || archiveGenerator != 0;
|
||||||
installsLibrary = installsLibrary || libraryGenerator != 0;
|
installsLibrary = installsLibrary || libraryGenerator != 0;
|
||||||
|
|
|
@ -168,9 +168,7 @@ public:
|
||||||
"On non-DLL platforms mySharedLib will be installed to <prefix>/lib "
|
"On non-DLL platforms mySharedLib will be installed to <prefix>/lib "
|
||||||
"and /some/full/path. On DLL platforms the mySharedLib DLL will be "
|
"and /some/full/path. On DLL platforms the mySharedLib DLL will be "
|
||||||
"installed to <prefix>/bin and /some/full/path and its import library "
|
"installed to <prefix>/bin and /some/full/path and its import library "
|
||||||
"will be installed to <prefix>/lib/static and /some/full/path. "
|
"will be installed to <prefix>/lib/static and /some/full/path."
|
||||||
"On non-DLL platforms mySharedLib will be installed to <prefix>/lib "
|
|
||||||
"and /some/full/path."
|
|
||||||
"\n"
|
"\n"
|
||||||
"The EXPORT option associates the installed target files with an "
|
"The EXPORT option associates the installed target files with an "
|
||||||
"export called <export-name>. "
|
"export called <export-name>. "
|
||||||
|
|
Loading…
Reference in New Issue