]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat
Feature #1956 Add Version file in final install + link in menu windows
[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 thirdparty_cmake=%cd%\..\cmake
26
27 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
28
29 set thirdpartydllspath=%thirdpartyGeneration%\thirdparty_temp\creaThirdParty_dlls
30 set sourcepath=%thirdparty_cmake%\crea_ThirdParty_dlls
31 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%\crea_ThirdParty_dlls_Bin
32
33 if not exist %vcvarsall% set zipPath="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
34 if not exist %vcvarsall% (
35   echo ERROR!!! Visual Studio has not been found in the system
36   exit
37 )
38
39 if %x86Comp%==ON (
40         call %vcvarsall%
41         set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_dlls"
42         echo "Compilation forced x86"
43 ) else (
44         if %PROCESSOR_ARCHITECTURE%==x86 (
45                 call %vcvarsall%
46                 set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_dlls"
47         ) else (
48                 call %vcvarsall% amd64
49                 set installpath="%ProgramFiles%\creatools\crea_ThirdParty_dlls"
50         )
51 )
52
53 rmdir /S /Q %binpath%
54 mkdir %binpath%
55 cd %binpath%
56
57 if %x86Comp%==ON (
58         set buildPlatform=win32
59         cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
60 ) else (
61         if %PROCESSOR_ARCHITECTURE%==x86 (
62                 set buildPlatform=win32
63                 cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
64         ) else (
65                 set buildPlatform=win64
66                 cmake -G"Visual Studio 10 Win64"  -H%sourcepath% -B%binpath%
67         )
68 )
69
70 cmake -D CREATOOLS_BUILDTYPE:STRING=%buildType% -D CREATOOLS_PLATFORM:STRING=%buildPlatform%  CMakeCache.txt
71 cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt
72 cmake -D CREA_LIBRARY_DLL_PATH:PATH=%thirdpartydllspath% CMakeCache.txt
73 cmake CMakeCache.txt
74
75 FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType%
76 msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% PACKAGE.vcxproj
77
78 exit /B