]> Creatis software - creaToolsTools.git/blob - Install_mingw64/Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat
#3200 creaToolsTools Feature New Normal branch mingw64
[creaToolsTools.git] / Install_mingw64 / 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
10 ::if %PROCESSOR_ARCHITECTURE%==x86 (
11 ::  set ProgramFilesPath_x86=%ProgramFiles%
12 ::  echo "Architecture found = x86"
13 ::) else (
14 ::  set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
15 ::  echo "Architecture found = x64"
16 ::)
17
18 echo ----End Asking Architecture--------
19
20 set thirdpartyGeneration=%1
21 set buildType=%2
22 ::The following line is to force x86 or x64 compilation
23 set x86Comp=%3
24
25
26 set thirdparty_cmake=%cd%\..\cmake
27
28 ::set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
29
30 set thirdpartydllspath=%thirdpartyGeneration%\tpi\
31 set sourcepath=%thirdparty_cmake%\crea_ThirdParty_dlls
32 set binpath=%thirdpartyGeneration%\tpb\crea_ThirdParty_dlls_Bin
33 ::set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_dlls"
34
35 ::if not exist %vcvarsall% set zipPath="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
36 ::if not exist %vcvarsall% (
37 ::  echo ERROR!!! Visual Studio has not been found in the system
38 ::  exit
39 ::)
40
41 ::if %x86Comp%==ON (
42 ::      call %vcvarsall%
43 ::      set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_dlls"
44 ::      echo "Compilation forced x86"
45 ::) else (
46 ::      if %PROCESSOR_ARCHITECTURE%==x86 (
47 ::              call %vcvarsall%
48 ::              set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_dlls"
49 ::      ) else (
50 ::              call %vcvarsall% amd64
51 ::              set installpath="%ProgramFiles%\creatools\crea_ThirdParty_dlls"
52 ::      )
53 ::)
54
55 rmdir /S /Q %binpath%
56 mkdir %binpath%
57 cd %binpath%
58
59 ::if %x86Comp%==ON (
60 ::      set buildPlatform=win32
61 ::      cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
62 ::) else (
63 ::      if %PROCESSOR_ARCHITECTURE%==x86 (
64 ::              set buildPlatform=win32
65 ::              cmake -G"Visual Studio 10"  -H%sourcepath% -B%binpath%
66 ::      ) else (
67 ::              set buildPlatform=win64
68 ::              cmake -G"Visual Studio 10 Win64"  -H%sourcepath% -B%binpath%
69 ::      )
70 ::)
71
72 ::cmake -D CREATOOLS_BUILDTYPE:STRING=%buildType% -D CREATOOLS_PLATFORM:STRING=%buildPlatform%  CMakeCache.txt
73 ::cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt
74 ::cmake -D CREA_LIBRARY_DLL_PATH:PATH=%thirdpartydllspath% CMakeCache.txt
75 ::cmake CMakeCache.txt
76 ::FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType%
77 ::msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% PACKAGE.vcxproj
78
79 %cmakeBin% -G"MinGW Makefiles" -H%sourcepath% -B%binpath%                                                                               >> %LogFolder%\dlls_cmake.log 2>&1
80 %cmakeBin% -D CMAKE_BUILD_TYPE:STRING=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt         >> %LogFolder%\dlls_cmake.log 2>&1
81 %cmakeBin% -D CREA_LIBRARY_DLL_PATH:PATH=%thirdpartydllspath% CMakeCache.txt                                        >> %LogFolder%\dlls_cmake.log 2>&1
82 mingw32-make.exe package                                                                                                                >> %LogFolder%\dlls_cmake.log 2>&1
83
84
85 exit /B