Commits

anki...@gmail.com  committed 7090f91

1. Precheck for python under Windows environvent variable for building Boost.Python
2. Before copying b2.exe, a pre check for it's existence.

  • Participants
  • Parent commits 398ba8f

Comments (0)

Files changed (2)

File BlueGo/BuildProcess/Boost.cs

                 }
 
                 // remove downloaded file
-                System.IO.File.Delete(destinationFolder + boostZIPFilename);
+                if (File.Exists(Path.Combine(destinationFolder, boostZIPFilename)))
+                {
+                    System.IO.File.Delete(Path.Combine(destinationFolder, boostZIPFilename));
+                }
 
                 message("boost successfully built!");
                               
 
                         // change directory to boost_1_51_0-x64\tools\build\v2
                         string path = System.Windows.Forms.Application.StartupPath;
-                        File.Copy(path + "\\b2.exe", destinationFolder + extractFolderName + "\\b2.exe");
+                        if (!File.Exists(Path.Combine(destinationFolder, extractFolderName, "b2.exe")) && File.Exists(Path.Combine(path, "b2.exe")))
+                        {
+                            File.Copy(Path.Combine(path, "b2.exe"), Path.Combine(destinationFolder, extractFolderName, "b2.exe"));
+                        }
+
                         sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-11.0 address-model=64 --build-type=complete stage"); // todo find out number of cores...
                     }
                 }
                     eBoostVersion version = boostVersion;
                     string extractFolderName = BoostInfo.GetBoostInfo(version).ExtractFolderName;
 
-                    File.Copy(destinationFolder + extractFolderName + @"\tools\build\v2" + "\\b2.exe", destinationFolder + extractFolderName + "\\b2.exe");
+                    if (!File.Exists(Path.Combine(destinationFolder, extractFolderName, "b2.exe")) && File.Exists(Path.Combine(destinationFolder, extractFolderName, @"tools\build\v2", "b2.exe")))
+                    {
+                        File.Copy(Path.Combine(destinationFolder, extractFolderName, @"tools\build\v2", "b2.exe"), Path.Combine(destinationFolder, extractFolderName, "b2.exe"));
+                    }
+
                     sw.WriteLine("cd /D " + destinationFolder + extractFolderName);
 
                     if(platform == ePlatform.x64)

File BlueGo/FormMain.cs

 
             BoostBuildProcess boostBuildProcess = new BoostBuildProcess(bbpd);
 
+            if (bbpd.withLibraries.Contains("python") && !Executable.ExistsOnPath("python.exe"))
+            {
+                if (MessageBox.Show("Warning: Python could not be found on the Windows path. (Add python.exe to the Windows path to build boost successfully) ",
+                    "Warning",
+                     MessageBoxButtons.OK) == DialogResult.OK)
+                {
+                    buttonBoostBuild.Enabled = true;
+                    return;
+                }
+            }
+
             boostBuildProcess.Message += new MessageEventHandler(boostBuildProcess_Message);
             boostBuildProcess.StandardOutputMessage += new StandardOutputMessageEventHandler(boostBuildProcess_StandardOutputMessage);
             boostBuildProcess.StandardErrorMessage += new StandardErrorMessageEventHandler(boostBuildProcess_StandardErrorMessage);