]> Creatis software - creaToolsTools.git/blobdiff - Install/scripts/compilemod.bat
DFCH: creaTools script for visual studio 2010 x64 working!!! =)
[creaToolsTools.git] / Install / scripts / compilemod.bat
index 777a79d9dc2e0c2d40f51725a361b2834d9b437b..d046704e47effc3a18f5000db91c62e0ebb40861 100644 (file)
@@ -2,12 +2,41 @@ REM %1 = <buildtype>
 REM %2 = <Module Sources Ex crea bbtk creaMaracasVisu ...>
 REM %3 = <creatoolsGeneration>
 
+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
-FOR /R %%a IN (*.sln) DO msbuild /p:Configuration=%1 INSTALL.vcproj
-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 %%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\
+)