[Cmake-commits] [cmake-commits] king committed cmInstallCommand.cxx 1.45 1.46 cmInstallCommand.h 1.29 1.30 cmPolicies.cxx 1.28 1.29 cmPolicies.h 1.13 1.14

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Apr 14 17:53:13 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv1163/Source

Modified Files:
	cmInstallCommand.cxx cmInstallCommand.h cmPolicies.cxx 
	cmPolicies.h 
Log Message:
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


Index: cmInstallCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C 2 -d -r1.29 -r1.30
*** cmInstallCommand.h	4 Feb 2008 22:03:48 -0000	1.29
--- cmInstallCommand.h	14 Apr 2008 21:53:11 -0000	1.30
***************
*** 347,350 ****
--- 347,351 ----
                           const std::vector<std::string>& relFiles,
                           std::vector<std::string>& absFiles);
+   bool CheckCMP0006(bool& failure);
  };
  

Index: cmPolicies.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C 2 -d -r1.13 -r1.14
*** cmPolicies.h	13 Mar 2008 21:11:57 -0000	1.13
--- cmPolicies.h	14 Apr 2008 21:53:11 -0000	1.14
***************
*** 47,50 ****
--- 47,51 ----
      CMP0004, // Libraries linked may not have leading or trailing whitespace
      CMP0005, // Definition value escaping
+     CMP0006, // BUNDLE install rules needed for MACOSX_BUNDLE targets
  
      // Always the last entry.  Useful mostly to avoid adding a comma

Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -C 2 -d -r1.28 -r1.29
*** cmPolicies.cxx	31 Mar 2008 17:33:09 -0000	1.28
--- cmPolicies.cxx	14 Apr 2008 21:53:11 -0000	1.29
***************
*** 252,255 ****
--- 252,273 ----
      "limitations of the escaping implementation.",
      2,6,0, cmPolicies::WARN);
+ 
+   this->DefinePolicy(
+     CMP0006, "CMP0006",
+     "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.",
+     "This policy determines whether the install(TARGETS) command must be "
+     "given a BUNDLE DESTINATION when asked to install a target with the "
+     "MACOSX_BUNDLE property set.  "
+     "CMake 2.4 and below did not distinguish application bundles from "
+     "normal executables when installing targets.  "
+     "CMake 2.6 provides a BUNDLE option to the install(TARGETS) command "
+     "that specifies rules specific to application bundles on the Mac.  "
+     "Projects should use this option when installing a target with the "
+     "MACOSX_BUNDLE property set.\n"
+     "The OLD behavior for this policy is to fall back to the RUNTIME "
+     "DESTINATION if a BUNDLE DESTINATION is not given.  "
+     "The NEW behavior for this policy is to produce an error if a bundle "
+     "target is installed without a BUNDLE DESTINATION.",
+     2,6,0, cmPolicies::WARN);
  }
  

Index: cmInstallCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.cxx,v
retrieving revision 1.45
retrieving revision 1.46
diff -C 2 -d -r1.45 -r1.46
*** cmInstallCommand.cxx	7 Feb 2008 21:22:00 -0000	1.45
--- cmInstallCommand.cxx	14 Apr 2008 21:53:11 -0000	1.46
***************
*** 537,541 ****
                                                             false);
              }
!           else
              {
              cmOStringStream e;
--- 537,556 ----
                                                             false);
              }
!           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;
***************
*** 1285,1286 ****
--- 1300,1332 ----
    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;
+ }



More information about the Cmake-commits mailing list