From: Diego Caceres Date: Mon, 19 Dec 2011 17:11:35 +0000 (+0000) Subject: DFCH: Compiler updates X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f1465d67df5d41625d345d6916e2506d4b36a5ca;p=creaToolsTools.git DFCH: Compiler updates --- diff --git a/Install/scripts/cmakemod.bat b/Install/scripts/cmakemod.bat index 5848a4e..c91daef 100644 --- a/Install/scripts/cmakemod.bat +++ b/Install/scripts/cmakemod.bat @@ -2,9 +2,30 @@ REM %1 = REM %2 = REM %3 = +if %PROCESSOR_ARCHITECTURE%==x86 ( + set ProgramFilesPath_x86=%ProgramFiles% + echo "Architecture found = x86" +) else ( + set "ProgramFilesPath_x86=%ProgramFiles(x86)%" + echo "Architecture found = x64" +) + +set compilerVersion="Visual Studio 10" +set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% ( + set compilerVersion="Visual Studio 9 2008" + set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% ( + echo ERROR!!! Visual Studio has not been found in the system + exit + ) +) + set binfolder=%3\creatools_bin\%1Bin cd %binfolder% -cmake -G"Visual Studio 9 2008" -H%3\creatools_sources\%1 -B%3\creatools_bin\%1Bin +cmake -G%compilerVersion% -H%3\creatools_sources\%1 -B%3\creatools_bin\%1Bin cmake -D INCLUDE_CTEST:BOOL=ON -D CMAKE_INSTALL_PREFIX:PATH=%2\%1 CMakeCache.txt diff --git a/Install/scripts/compilemod.bat b/Install/scripts/compilemod.bat index beda3fb..382d4b5 100644 --- a/Install/scripts/compilemod.bat +++ b/Install/scripts/compilemod.bat @@ -2,11 +2,44 @@ REM %1 = REM %2 = REM %3 = +if %PROCESSOR_ARCHITECTURE%==x86 ( + set ProgramFilesPath_x86=%ProgramFiles% + echo "Architecture found = x86" +) else +( + set "ProgramFilesPath_x86=%ProgramFiles(x86)%" + echo "Architecture found = x64" +) +set compilerVersion="Visual Studio 10" +set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% ( + set compilerVersion="Visual Studio 9 2008" + set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% ( + echo ERROR!!! Visual Studio has not been found in the system + exit + ) +) + +call %vcvarsall% + set binfolder=%3\creatools_bin\%2Bin cd %binfolder% -call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" -FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%1 -msbuild /p:Configuration=%1 INSTALL.vcproj -msbuild /p:Configuration=%1 PACKAGE.vcproj -copy %2*.exe %3\Result_Installers\ +if %compilerVersion%=="Visual Studio 10" +( + FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%1 + msbuild /p:Configuration=%1 ALL_BUILD.vcxproj + msbuild /p:Configuration=%1 INSTALL.vcxproj + msbuild /p:Configuration=%1 PACKAGE.vcxproj + copy %2*.exe %3\Result_Installers\ +) +else +( + FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%1 + msbuild /p:Configuration=%1 INSTALL.vcproj + msbuild /p:Configuration=%1 PACKAGE.vcproj + copy %2*.exe %3\Result_Installers\ +) diff --git a/Install/scripts/compilemodCreaTools.bat b/Install/scripts/compilemodCreaTools.bat index 8333bf8..810e4ac 100644 --- a/Install/scripts/compilemodCreaTools.bat +++ b/Install/scripts/compilemodCreaTools.bat @@ -2,9 +2,40 @@ REM %1 = REM %2 = REM %3 = +if %PROCESSOR_ARCHITECTURE%==x86 ( + set ProgramFilesPath_x86=%ProgramFiles% + echo "Architecture found = x86" +) else +( + set "ProgramFilesPath_x86=%ProgramFiles(x86)%" + echo "Architecture found = x64" +) +set compilerVersion="Visual Studio 10" +set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +if not exist %vcvarsall% ( + set compilerVersion="Visual Studio 9 2008" + set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" + if not exist %vcvarsall% ( + echo ERROR!!! Visual Studio has not been found in the system + exit + ) +) + +call %vcvarsall% + set binfolder=%3\creatools_bin\%1Bin cd %binfolder% -call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" -FOR /R %%a IN (*.sln) DO msbuild /p:Configuration=%1 PACKAGE.vcproj -copy %2*.exe %3\Result_Installers\ + +if %compilerVersion%=="Visual Studio 10" +( + FOR /R %%a IN (*.sln) DO msbuild /p:Configuration=%1 PACKAGE.vcxproj + copy %2*.exe %3\Result_Installers\ +) +else +( + FOR /R %%a IN (*.sln) DO msbuild /p:Configuration=%1 PACKAGE.vcproj + copy %2*.exe %3\Result_Installers\ +)