diff options
author | Brad King <brad.king@kitware.com> | 2019-07-31 19:17:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-31 23:32:55 (GMT) |
commit | d70a0f8681919713940d254f9e23141f69f68c31 (patch) | |
tree | 52ece17592afe59331a49ffd887998d6f9124d49 /Source/cmInstallCommand.cxx | |
parent | f43a7d76c737c5bb9b903a2b1be5186c081ec21e (diff) | |
download | CMake-d70a0f8681919713940d254f9e23141f69f68c31.zip CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.gz CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.bz2 |
fileapi: Fix codemodel target install destination for cross-dir rules
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling
`install(TARGETS)` for targets created in another directory. However,
install generators are associated with the directory in which the call
to `install()` appears. This may not be the same directory in which the
target is defined. Record in each target the list of install generators
it has.
Fixes: #19546
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index dba4bbb..c9e6923 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -43,11 +43,13 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator( target.SetHaveInstallRule(true); const char* component = namelink ? args.GetNamelinkComponent().c_str() : args.GetComponent().c_str(); - return new cmInstallTargetGenerator( + auto g = new cmInstallTargetGenerator( target.GetName(), destination.c_str(), impLib, args.GetPermissions().c_str(), args.GetConfigurations(), component, message, args.GetExcludeFromAll(), args.GetOptional() || forceOpt, backtrace); + target.AddInstallGenerator(g); + return g; } static cmInstallTargetGenerator* CreateInstallTargetGenerator( |