diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-05 14:13:06 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-05 14:13:06 (GMT) |
commit | 7b1440ab9fef6d240eb5beb333ac606f966486a4 (patch) | |
tree | 6726bf3178e42757fedb06ce1623c76f29d7eb59 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 11cd7b0b3f20b384220e65c4ef9de5afea0b1618 (diff) | |
download | CMake-7b1440ab9fef6d240eb5beb333ac606f966486a4.zip CMake-7b1440ab9fef6d240eb5beb333ac606f966486a4.tar.gz CMake-7b1440ab9fef6d240eb5beb333ac606f966486a4.tar.bz2 |
ENH: fix bundles for Mac and Xcode
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 7eb32d2..b8d080a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1373,6 +1373,27 @@ cmLocalUnixMakefileGenerator3 // Make bundle directories outpath += target.GetName(); outpath += ".app/Contents/MacOS/"; + std::string f1 = m_Makefile->GetModulesFile("MacOSXBundleInfo.plist.in"); + if ( f1.size() == 0 ) + { + cmSystemTools::Error("could not find Mac OSX bundle template file."); + } + std::string macdir = m_Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"); + if ( macdir.size() == 0 ) + { + macdir = m_Makefile->GetCurrentOutputDirectory(); + } + if(macdir.size() && macdir[macdir.size()-1] != '/') + { + macdir += "/"; + } + macdir += target.GetName(); + macdir += ".app/Contents/"; + std::string f2 = macdir + "Info.plist"; + macdir += "MacOS"; + cmSystemTools::MakeDirectory(macdir.c_str()); + m_Makefile->AddDefinition("MACOSX_BUNDLE_EXECUTABLE_NAME", target.GetName()); + m_Makefile->ConfigureFile(f1.c_str(), f2.c_str(), false, false, false); } #endif std::string targetFullPath = outpath + targetName; |