diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmInstallCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmInstallFilesCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmInstallGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/cmInstallGenerator.h | 7 | ||||
-rw-r--r-- | Source/cmInstallProgramsCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 2 |
6 files changed, 42 insertions, 7 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index d0eea35..f4af460 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -26,7 +26,7 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target, const cmInstallCommandArguments& args, bool impLib, bool forceOpt = false) { cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(target.GetMakefile()); return new cmInstallTargetGenerator(target, args.GetDestination().c_str(), impLib, args.GetPermissions().c_str(), args.GetConfigurations(), args.GetComponent().c_str(), @@ -40,7 +40,7 @@ static cmInstallFilesGenerator* CreateInstallFilesGenerator( const cmInstallCommandArguments& args, bool programs) { cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(mf); return new cmInstallFilesGenerator(mf, absFiles, args.GetDestination().c_str(), programs, args.GetPermissions().c_str(), @@ -1215,7 +1215,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args) } cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(this->Makefile); // Create the directory install generator. this->Makefile->AddInstallGenerator( @@ -1344,7 +1344,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args) } cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(this->Makefile); // Create the export install generator. cmInstallExportGenerator* exportGenerator = diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 1d648c9..f106e1a 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -133,7 +133,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(this->Makefile); this->Makefile->AddInstallGenerator( new cmInstallFilesGenerator(this->Makefile, this->Files, destination.c_str(), false, diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 0bc4073..7c6c5ae 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmInstallGenerator.h" +#include "cmMakefile.h" #include "cmSystemTools.h" //---------------------------------------------------------------------------- @@ -98,6 +99,13 @@ void cmInstallGenerator { os << " OPTIONAL"; } + switch(this->Message) + { + case MessageDefault: break; + case MessageAlways: os << " MESSAGE_ALWAYS"; break; + case MessageLazy: os << " MESSAGE_LAZY"; break; + case MessageNever: os << " MESSAGE_NEVER"; break; + } if(permissions_file && *permissions_file) { os << " PERMISSIONS" << permissions_file; @@ -182,3 +190,23 @@ std::string cmInstallGenerator::GetInstallDestination() const result += this->Destination; return result; } + +//---------------------------------------------------------------------------- +cmInstallGenerator::MessageLevel +cmInstallGenerator::SelectMessageLevel(cmMakefile* mf) +{ + std::string m = mf->GetSafeDefinition("CMAKE_INSTALL_MESSAGE"); + if(m == "ALWAYS") + { + return MessageAlways; + } + if(m == "LAZY") + { + return MessageLazy; + } + if(m == "NEVER") + { + return MessageNever; + } + return MessageDefault; +} diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index 8e8db40..e32276f 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -16,6 +16,7 @@ #include "cmScriptGenerator.h" class cmLocalGenerator; +class cmMakefile; /** \class cmInstallGenerator * \brief Support class for generating install scripts. @@ -27,6 +28,9 @@ public: enum MessageLevel { MessageDefault, + MessageAlways, + MessageLazy, + MessageNever }; cmInstallGenerator(const char* destination, @@ -56,6 +60,9 @@ public: /** Test if this generator installs something for a given configuration. */ bool InstallsForConfig(const std::string& config); + /** Select message level from CMAKE_INSTALL_MESSAGE. */ + static MessageLevel SelectMessageLevel(cmMakefile* mf); + protected: virtual void GenerateScript(std::ostream& os); diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 18d7546..0405769 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -94,7 +94,7 @@ void cmInstallProgramsCommand::FinalPass() "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; cmInstallGenerator::MessageLevel message = - cmInstallGenerator::MessageDefault; + cmInstallGenerator::SelectMessageLevel(this->Makefile); this->Makefile->AddInstallGenerator( new cmInstallFilesGenerator(this->Makefile, this->Files, destination.c_str(), true, diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ec89bde..a1dbaa5 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3004,7 +3004,7 @@ public: cmInstallTargetGeneratorLocal(cmTarget& t, const char* dest, bool implib): cmInstallTargetGenerator( t, dest, implib, "", std::vector<std::string>(), "Unspecified", - MessageDefault, + cmInstallGenerator::SelectMessageLevel(t.GetMakefile()), false) {} }; |