From 69f2f75d8b709639809bc8c7cb797b4d0ca95774 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 3 May 2011 17:19:00 +0300 Subject: [PATCH] OP-305: update sh.cmd to make easier to add more tools to the PATH --- make/win32/sh.cmd | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/make/win32/sh.cmd b/make/win32/sh.cmd index e33b34e43..fb7b22952 100644 --- a/make/win32/sh.cmd +++ b/make/win32/sh.cmd @@ -29,15 +29,23 @@ rem To build the OpenPilot software we need few tools in the PATH. rem Here we attempt to guess tools location using PATH or set them rem directly using hard-coded locations, if not found in PATH. rem You may want to update paths according to your installation. +rem +rem Also you can add any paths below just by adding extra call :which +rem lines with the following parameters: +rem - environment variable which will be set to the path found (or empty) +rem - expected directory which will be tried if not found in the current PATH +rem - any executable file which is expected to be found in PATH or directory +rem All they will be added to the PATH in order of appearance. rem -------------------------------------------------------------------------- set NOT_FOUND= +set PATH_DIRS= -call :which PYTHON "C:\Python27" python.exe -call :which CODESOURCERY "C:\CodeSourcery\bin" cs-make.exe -call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe -call :which QTMINGW "C:\Qt\2010.05\mingw\bin" mingw32-make.exe call :which MSYSGIT "%ProgramFiles%\Git\bin" git.exe +call :which QTMINGW "C:\Qt\2010.05\mingw\bin" mingw32-make.exe +call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe +call :which CODESOURCERY "C:\CodeSourcery\bin" cs-make.exe +call :which PYTHON "C:\Python27" python.exe call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe if "%NOT_FOUND%" == "" goto set_path @@ -55,7 +63,7 @@ rem -------------------------------------------------------------------------- :set_path set PATH=%SYSTEMROOT%\system32;%SYSTEMROOT% -set PATH=%MSYSGIT%;%QTMINGW%;%QTSDK%;%CODESOURCERY%;%PYTHON%;%UNSIS%;%PATH% +set PATH=%PATH_DIRS%;%PATH% rem echo PATH: %PATH% rem -------------------------------------------------------------------------- @@ -104,4 +112,7 @@ rem echo %3: found at: %FP% rem set results regardless of was it found or not set %1=%FP% rem echo %1=%FP% +if "%FP%" == "" goto :eof +if not "%PATH_DIRS%" == "" set PATH_DIRS=%PATH_DIRS%; +set PATH_DIRS=%PATH_DIRS%%FP% goto :eof