diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2023-02-24 15:17:45 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2023-02-24 15:17:45 (GMT) |
commit | 18e02ace5b2c2318252acea5f53062ef8bd0e3c6 (patch) | |
tree | 2fd11fc551fa2e1da1a21f11ba20cdc73f22e27b /Source/cmInstallCommand.cxx | |
parent | 35ca2d524befc71b840808cce4e0a773ef722b71 (diff) | |
download | CMake-18e02ace5b2c2318252acea5f53062ef8bd0e3c6.zip CMake-18e02ace5b2c2318252acea5f53062ef8bd0e3c6.tar.gz CMake-18e02ace5b2c2318252acea5f53062ef8bd0e3c6.tar.bz2 |
install(CODE|SCRIPT): Support $<INSTALL_PREFIX> genex
Fixes: #24534
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 16 |
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>( |