summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 82adca8..56c8b26 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -359,13 +359,15 @@ bool HandleScriptMode(std::vector<std::string> const& args,
} else if (doing_script) {
doing_script = false;
std::string script = arg;
- if (!cmSystemTools::FileIsFullPath(script)) {
- script =
- cmStrCat(helper.Makefile->GetCurrentSourceDirectory(), '/', arg);
- }
- if (cmSystemTools::FileIsDirectory(script)) {
- status.SetError("given a directory as value of SCRIPT argument.");
- return false;
+ if (!cmHasLiteralPrefix(script, "$<INSTALL_PREFIX>")) {
+ if (!cmSystemTools::FileIsFullPath(script)) {
+ script =
+ cmStrCat(helper.Makefile->GetCurrentSourceDirectory(), '/', arg);
+ }
+ if (cmSystemTools::FileIsDirectory(script)) {
+ status.SetError("given a directory as value of SCRIPT argument.");
+ return false;
+ }
}
helper.Makefile->AddInstallGenerator(
cm::make_unique<cmInstallScriptGenerator>(