]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat
DFCH: Install_ThirdParty script is now working in windows x64 =)
[creaToolsTools.git] / Install_ThirdParty / scripts / install_thirdparty_dlls_cmake.bat
1 @echo off
2 echo -----------------------------------
3 echo -----Generating Installers of------
4 echo -------creaThirdPartyDlls----------
5 echo -----------------------------------
6 echo -----------------------------------
7 echo ------Asking Architecture----------
8 echo -----------------------------------
9 if %PROCESSOR_ARCHITECTURE%==x86 (
10   set ProgramFilesPath_x86=%ProgramFiles%
11   echo "Architecture found = x86"
12 ) else (
13   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
14   echo "Architecture found = x64"
15 )
16
17 echo ----End Asking Architecture--------
18
19 set thirdpartyGeneration=%1
20 set buildType=%2
21 ::The following line is to force x86 or x64 compilation
22 set x86Comp=%3
23
24
25 set version="3.0.1-win32"
26
27 set thirdparty_cmake=%cd%\..\cmake
28
29 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
30
31 set thirdpartydllspath=%thirdpartyGeneration%\thirdparty_temp\creaThirdParty_dlls
32 set sourcepath=%thirdparty_cmake%\crea_ThirdParty_dlls
33 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%\crea_ThirdParty_dlls_Bin
34 set installpath="ProgramFilesPath_x86\creatools\crea_ThirdParty_dlls"
35
36 if not exist %vcvarsall% set zipPath="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
37 if not exist %vcvarsall% (
38   echo ERROR!!! Visual Studio has not been found in the system
39   exit
40 )
41
42 if %x86Comp%==ON (
43         call %vcvarsall%
44         echo "Compilation forced x86"
45 ) else (
46         if %PROCESSOR_ARCHITECTURE%==x86 (
47                 call %vcvarsall%
48         ) else (
49                 call %vcvarsall% amd64
50         )
51 )
52
53 mkdir %binpath%
54 cd %binpath%
55
56 if %x86Comp%==ON (
57         cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
58 ) else (
59         if %PROCESSOR_ARCHITECTURE%==x86 (
60                 cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
61         ) else (
62                 cmake -G"Visual Studio 10 Win64"  -H%sourcepath% -B%binpath%
63         )
64 )
65
66 cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt
67 cmake -D CREA_LIBRARY_DLL_PATH:PATH=%thirdpartydllspath% CMakeCache.txt
68 cmake CMakeCache.txt
69
70 FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType%
71 msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% PACKAGE.vcxproj
72
73 set installerPath="%thirdpartydllspath%\thirdparty_bin\crea_ThirdParty_dlls_Bin\crea_ThirdParty_dlls-%version%.exe"
74
75 if exist installerPath (
76 mkdir %thirdpartyGeneration%\thirdparty_installers
77 move /Y %installerPath% %thirdpartyGeneration%\thirdparty_installers
78 )
79
80 exit /B