[cmake-commits] king committed cmMakefileExecutableTargetGenerator.cxx 1.29 1.30

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 9 14:50:13 EST 2007


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

Modified Files:
	cmMakefileExecutableTargetGenerator.cxx 
Log Message:
BUG: Fixed OSX bundles to be built in the directory specified by cmTarget::GetDirectory().  This is an incremental step for bug#2240.


Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cmMakefileExecutableTargetGenerator.cxx	8 Mar 2007 20:33:19 -0000	1.29
+++ cmMakefileExecutableTargetGenerator.cxx	9 Mar 2007 19:50:11 -0000	1.30
@@ -121,27 +121,22 @@
 #ifdef __APPLE__
   if(this->Target->GetPropertyAsBool("MACOSX_BUNDLE"))
     {
+    // Compute bundle directory names.
+    std::string macdir = outpath;
+    macdir += targetName;
+    macdir += ".app/Contents/";
+    outpath = macdir;
+    outpath += "MacOS";
+    cmSystemTools::MakeDirectory(outpath.c_str());
+    outpath += "/";
+
     // Make bundle directories
-    outpath += targetName;
-    outpath += ".app/Contents/MacOS/";
     std::string f1 =
       this->Makefile->GetModulesFile("MacOSXBundleInfo.plist.in");
     if ( f1.size() == 0 )
       {
       cmSystemTools::Error("could not find Mac OSX bundle template file.");
       }
-    std::string macdir =
-      this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
-    if ( macdir.size() == 0 )
-      {
-      macdir = this->Makefile->GetCurrentOutputDirectory();
-      }
-    if(macdir.size() && macdir[macdir.size()-1] != '/')
-      {
-      macdir += "/";
-      }
-    macdir += targetName;
-    macdir += ".app/Contents/";
 
     std::vector<cmSourceFile*>::iterator sourceIt;
     for ( sourceIt = this->Target->GetSourceFiles().begin();
@@ -166,8 +161,6 @@
     // Configure the Info.plist file.  Note that it needs the executable name
     // to be set.
     std::string f2 = macdir + "Info.plist";
-    macdir += "MacOS";
-    cmSystemTools::MakeDirectory(macdir.c_str());
     this->Makefile->AddDefinition("MACOSX_BUNDLE_EXECUTABLE_NAME",
                                   targetName.c_str());
     this->Makefile->ConfigureFile(f1.c_str(), f2.c_str(), 



More information about the Cmake-commits mailing list