diff options
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 8cbcd4e..92a4b2b 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -716,9 +716,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cm.AddCMakePaths(); cm.SetProgressCallback(cmCPackGeneratorProgress, this); cmGlobalGenerator gg(&cm); + cmsys::auto_ptr<cmMakefile> mf( + new cmMakefile(&gg, cm.GetCurrentSnapshot())); cmsys::auto_ptr<cmLocalGenerator> lg( - gg.CreateLocalGenerator(cm.GetCurrentSnapshot())); - cmMakefile *mf = lg->GetMakefile(); + gg.CreateLocalGenerator(mf.get())); std::string realInstallDirectory = tempInstallDirectory; if ( !installSubDirectory.empty() && installSubDirectory != "/" ) { diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 96351f7..cb9cbc4 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -202,9 +202,10 @@ int main (int argc, char const* const* argv) cminst.SetHomeOutputDirectory(""); cminst.GetState()->RemoveUnscriptableCommands(); cmGlobalGenerator cmgg(&cminst); + cmsys::auto_ptr<cmMakefile> globalMF( + new cmMakefile(&cmgg, cminst.GetCurrentSnapshot())); cmsys::auto_ptr<cmLocalGenerator> cmlg( - cmgg.CreateLocalGenerator(cminst.GetCurrentSnapshot())); - cmMakefile* globalMF = cmlg->GetMakefile(); + cmgg.CreateLocalGenerator(globalMF.get())); #if defined(__CYGWIN__) globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); #endif @@ -358,8 +359,8 @@ int main (int argc, char const* const* argv) ++it ) { const char* gen = it->c_str(); - cmMakefile::ScopePushPop raii(globalMF); - cmMakefile* mf = globalMF; + cmMakefile::ScopePushPop raii(globalMF.get()); + cmMakefile* mf = globalMF.get(); cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Specified generator: " << gen << std::endl); if ( parsed && !mf->GetDefinition("CPACK_PACKAGE_NAME") ) |