diff options
author | Brad King <brad.king@kitware.com> | 2008-04-14 21:53:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-04-14 21:53:11 (GMT) |
commit | 067717a56a55d5a35c223170e5bad0427d0d63f3 (patch) | |
tree | 0d9c8b832623aa98658700d6d92bf0467996830d /Source/cmInstallCommand.cxx | |
parent | 3052d2c85412fba525efcc3e3cda2cac4426ff4b (diff) | |
download | CMake-067717a56a55d5a35c223170e5bad0427d0d63f3.zip CMake-067717a56a55d5a35c223170e5bad0427d0d63f3.tar.gz CMake-067717a56a55d5a35c223170e5bad0427d0d63f3.tar.bz2 |
BUG: Fix compatibility with CMake 2.4 for installation of MACOSX_BUNDLE targets
- Add policy CMP0006 to decide whether to use compatibility
- OLD behavior is to fall back to RUNTIME rules
- NEW behavior is to produce an error
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 80dcdfc..03bd159 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -536,7 +536,22 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) bundleGenerator = CreateInstallTargetGenerator(target, bundleArgs, false); } - else + if(!runtimeArgs.GetDestination().empty()) + { + bool failure = false; + if(this->CheckCMP0006(failure)) + { + // For CMake 2.4 compatibility fallback to the RUNTIME + // properties. + bundleGenerator = + CreateInstallTargetGenerator(target, runtimeArgs, false); + } + else if(failure) + { + return false; + } + } + if(!bundleGenerator) { cmOStringStream e; e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE " @@ -1284,3 +1299,34 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName, } return true; } + +//---------------------------------------------------------------------------- +bool cmInstallCommand::CheckCMP0006(bool& failure) +{ + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) + { + case cmPolicies::WARN: + { + this->Makefile->IssueMessage( + cmake::AUTHOR_WARNING, + this->Makefile->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0006) + ); + } + case cmPolicies::OLD: + // OLD behavior is to allow compatibility + return true; + case cmPolicies::NEW: + // NEW behavior is to disallow compatibility + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + failure = true; + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, + this->Makefile->GetPolicies() + ->GetRequiredPolicyError(cmPolicies::CMP0006) + ); + break; + } + return false; +} |