]> Creatis software - creaToolsTools.git/blob - Install/scripts/compilemod.bat
DFCH: Compiler updates
[creaToolsTools.git] / Install / scripts / compilemod.bat
1 REM %1 = <buildtype>  
2 REM %2 = <Module Sources Ex crea bbtk creaMaracasVisu ...>
3 REM %3 = <creatoolsGeneration>
4
5 if %PROCESSOR_ARCHITECTURE%==x86 (
6   set ProgramFilesPath_x86=%ProgramFiles%
7   echo "Architecture found = x86"
8 ) else (
9   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
10   echo "Architecture found = x64"
11 )
12 set compilerVersion="Visual Studio 10"
13 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
14 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
15 if not exist %vcvarsall% (
16   set compilerVersion="Visual Studio 9 2008"
17   set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
18   if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
19   if not exist %vcvarsall% (
20     echo ERROR!!! Visual Studio has not been found in the system
21     exit
22   )
23 )
24
25 call %vcvarsall%
26
27 set binfolder=%3\creatools_bin\%2Bin
28
29 cd %binfolder%
30 if %compilerVersion%=="Visual Studio 10" (
31         FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%1
32         msbuild /p:Configuration=%1 ALL_BUILD.vcxproj
33         msbuild /p:Configuration=%1 INSTALL.vcxproj
34         msbuild /p:Configuration=%1 PACKAGE.vcxproj
35         copy %2*.exe %3\Result_Installers\
36 )
37 else (
38         FOR /R %%a IN (*.sln) DO msbuild %%a /p:Configuration=%1
39         msbuild /p:Configuration=%1 INSTALL.vcproj
40         msbuild /p:Configuration=%1 PACKAGE.vcproj
41         copy %2*.exe %3\Result_Installers\
42 )