|
|
@@ -871,6 +871,47 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ cmPolicies::PolicyStatus status =
|
|
|
+ this->Makefile->GetPolicyStatus(cmPolicies::CMP0062);
|
|
|
+
|
|
|
+ cmGlobalGenerator *gg = this->Makefile->GetGlobalGenerator();
|
|
|
+ for(std::vector<std::string>::const_iterator fileIt = filesVector.begin();
|
|
|
+ fileIt != filesVector.end(); ++fileIt)
|
|
|
+ {
|
|
|
+ if (gg->IsExportedTargetsFile(*fileIt))
|
|
|
+ {
|
|
|
+ const char *modal = 0;
|
|
|
+ std::ostringstream e;
|
|
|
+ cmake::MessageType messageType = cmake::AUTHOR_WARNING;
|
|
|
+
|
|
|
+ switch(status)
|
|
|
+ {
|
|
|
+ case cmPolicies::WARN:
|
|
|
+ e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0062) << "\n";
|
|
|
+ modal = "should";
|
|
|
+ case cmPolicies::OLD:
|
|
|
+ break;
|
|
|
+ case cmPolicies::REQUIRED_IF_USED:
|
|
|
+ case cmPolicies::REQUIRED_ALWAYS:
|
|
|
+ case cmPolicies::NEW:
|
|
|
+ modal = "may";
|
|
|
+ messageType = cmake::FATAL_ERROR;
|
|
|
+ }
|
|
|
+ if (modal)
|
|
|
+ {
|
|
|
+ e << "The file\n " << *fileIt << "\nwas generated by the export() "
|
|
|
+ "command. It " << modal << " not be installed with the "
|
|
|
+ "install() command. Use the install(EXPORT) mechanism "
|
|
|
+ "instead. See the cmake-packages(7) manual for more.\n";
|
|
|
+ this->Makefile->IssueMessage(messageType, e.str());
|
|
|
+ if (messageType == cmake::FATAL_ERROR)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!ica.Finalize())
|
|
|
{
|
|
|
return false;
|