From: <st...@us...> - 2009-02-10 11:15:56
|
Revision: 3635 http://hugin.svn.sourceforge.net/hugin/?rev=3635&view=rev Author: stativ Date: 2009-02-10 11:15:52 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Export temp directory settings to makefile, so programs invoked by make can use it. Should fix bug #2036114. Modified Paths: -------------- hugin/trunk/src/hugin1/PT/utils.h hugin/trunk/src/hugin1/base_wx/RunStitchPanel.cpp hugin/trunk/src/hugin1/hugin/MainFrame.cpp hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h hugin/trunk/src/tools/pto2mk.cpp Modified: hugin/trunk/src/hugin1/PT/utils.h =================================================================== --- hugin/trunk/src/hugin1/PT/utils.h 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/hugin1/PT/utils.h 2009-02-10 11:15:52 UTC (rev 3635) @@ -44,7 +44,8 @@ const PTPrograms & progs, const std::string & includePath, std::vector<std::string> & outputFiles - std::ostream & o) + std::ostream & o, + std::string & tmpDir) { Panorama copyOfPano(pano); HuginBase::PanoramaMakefileExport(copyOfPano, o, images, ptofile, outputPrefix, progs, includePath).run(); Modified: hugin/trunk/src/hugin1/base_wx/RunStitchPanel.cpp =================================================================== --- hugin/trunk/src/hugin1/base_wx/RunStitchPanel.cpp 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/hugin1/base_wx/RunStitchPanel.cpp 2009-02-10 11:15:52 UTC (rev 3635) @@ -199,6 +199,7 @@ makeFile.Close(); std::string resultFn(basename.mb_str(HUGIN_CONV_FILENAME)); std::string tmpPTOfnC = (const char *) m_currentPTOfn.mb_str(HUGIN_CONV_FILENAME); + std::string tmpDir((wxConfigBase::Get()->Read(wxT("tempDir"),wxT(""))).mb_str(HUGIN_CONV_FILENAME)); std::vector<std::string> outputFiles; HuginBase::PanoramaMakefileExport::createMakefile(pano, @@ -208,7 +209,8 @@ progs, "", outputFiles, - makeFileStream); + makeFileStream, + tmpDir); // cd to output directory, if one is given. wxString oldCWD = wxFileName::GetCwd(); Modified: hugin/trunk/src/hugin1/hugin/MainFrame.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/MainFrame.cpp 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/hugin1/hugin/MainFrame.cpp 2009-02-10 11:15:52 UTC (rev 3635) @@ -547,6 +547,7 @@ wxString resultFnwx = scriptName.GetFullPath(); resultFn = resultFnwx.mb_str(HUGIN_CONV_FILENAME); resultFn = utils::stripPath(utils::stripExtension(resultFn)); + std::string tmpDir((wxConfigBase::Get()->Read(wxT("tempDir"),wxT(""))).mb_str(HUGIN_CONV_FILENAME)); std::vector<std::string> outputFiles; HuginBase::PanoramaMakefileExport::createMakefile(pano, @@ -556,7 +557,8 @@ progs, "", outputFiles, - makefile); + makefile, + tmpDir); } } SetStatusText(wxString::Format(_("saved project %s"), m_filename.c_str()),0); Modified: hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp =================================================================== --- hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp 2009-02-10 11:15:52 UTC (rev 3635) @@ -142,7 +142,8 @@ const PTPrograms& progs, const std::string& includePath, std::vector<std::string> & outputFiles, - std::ostream& o) + std::ostream& o, + const std::string& tmpDir) { PanoramaOptions opts = pano.getOptions(); #ifdef __unix__ @@ -173,6 +174,17 @@ o << "# makefile for panorama stitching, created by hugin " << endl << endl; + // pass settings for different temporary directory + if (tmpDir != "") { + o << "# set temporary directory" << endl; +#ifdef __unix__ + o << "export TMPDIR=" << quoteStringShell(tmpDir) << endl; +#else // WINDOWS + o << "export TEMP=" << quoteStringShell(tmpDir) << endl + << "export TMP=" << quoteStringShell(tmpDir) << endl; +#endif + } + o << endl << endl << "# Tool configuration" << endl Modified: hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h =================================================================== --- hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h 2009-02-10 11:15:52 UTC (rev 3635) @@ -105,7 +105,8 @@ const PTPrograms & progs, const std::string & includePath, std::vector<std::string> & outputFiles, - std::ostream & o); + std::ostream & o, + const std::string& tmpDir); public: @@ -118,7 +119,7 @@ { createMakefile(o_panorama, o_images, o_ptofile, o_outputPrefix, o_progs, o_includePath, - o_outputFiles, o_output); + o_outputFiles, o_output, o_tmpDir); return true; // let's hope so. } @@ -133,6 +134,7 @@ PTPrograms o_progs; std::vector<std::string> o_outputFiles; String o_includePath; + String o_tmpDir; }; Modified: hugin/trunk/src/tools/pto2mk.cpp =================================================================== --- hugin/trunk/src/tools/pto2mk.cpp 2009-02-09 21:43:53 UTC (rev 3634) +++ hugin/trunk/src/tools/pto2mk.cpp 2009-02-10 11:15:52 UTC (rev 3635) @@ -146,6 +146,7 @@ progs, "", outputFiles, - makeFileStream); + makeFileStream, + ""); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |