]> Creatis software - creaToolsTools.git/blob - Install/scripts/base/cmakemod.bat
e2da794d4834ce55b2b516de4b4d09c6e98f45fa
[creaToolsTools.git] / Install / scripts / base / cmakemod.bat
1 @echo off
2 echo ----------------------------
3 echo -------cmakemod.bat---------
4 echo ----------------------------
5
6 echo buildtype = %1 
7 echo installPrefix = %2
8 echo creatoolsGeneration = %3
9
10 echo Architecture found = %PROCESSOR_ARCHITECTURE%
11 if %PROCESSOR_ARCHITECTURE%==x86  (
12   set ProgramFilesPath_x86=%ProgramFiles%
13   set "compilerVersion=Visual Studio 10"
14 ) else (
15   set "ProgramFilesPath_x64=%ProgramFiles%"
16   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
17   set "compilerVersion=Visual Studio 10 Win64"
18 )
19 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
20 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
21 if not exist %vcvarsall% (
22   echo ERROR!!! Visual Studio has not been found in the system
23   exit
24 )
25
26 if %forcex86%==ON (
27         call %vcvarsall%
28         set "compilerVersion=Visual Studio 10"
29         echo "Compilation forced x86"
30 ) else (
31         if %PROCESSOR_ARCHITECTURE%==x86 (
32                 call %vcvarsall%
33         ) else (
34                 call %vcvarsall% amd64
35         )
36 )
37
38 set binfolder=%3\creatools_bin\%1Bin
39 cd %binfolder%
40
41 cmake -G"%compilerVersion%" -H%3\creatools_sources\%1 -B%3\creatools_bin\%1Bin
42 cmake -D INCLUDE_CTEST:BOOL=ON -D CMAKE_INSTALL_PREFIX:PATH=%2\%1 CMakeCache.txt
43
44 exit /B