install: Teach CODE,SCRIPT modes to evaluate generator expressions

This also introduces CMP0087 which will keep the OLD behaviour of not
evaluating generator expressions

Fixes: #15785
This commit is contained in:
Jon Chronopoulos
2018-12-23 09:03:38 +11:00
committed by Craig Scott
parent cb995ddea2
commit 25cae1e85d
16 changed files with 163 additions and 13 deletions
+13 -1
View File
@@ -6,10 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
#include <iosfwd>
#include <string>
class cmLocalGenerator;
/** \class cmInstallScriptGenerator
* \brief Generate target installation rules.
*/
@@ -20,10 +23,19 @@ public:
const char* component, bool exclude_from_all);
~cmInstallScriptGenerator() override;
void Compute(cmLocalGenerator* lg) override;
protected:
void GenerateScript(std::ostream& os) override;
void GenerateScriptActions(std::ostream& os, Indent indent) override;
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
void AddScriptInstallRule(std::ostream& os, Indent indent,
std::string const& script);
std::string Script;
bool Code;
cmLocalGenerator* LocalGenerator;
bool AllowGenex;
};
#endif