X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Install_ThirdParty%2Fscripts%2Finstall_thirdparty_libraries_cmake.bat;h=2f5f5b45ef590814bb44e5a5ad5cea1aeee925c1;hb=11c30fbd126b4a4c79ad39bb9ab2d5c22f6badbc;hp=cd24ef5c8bec4b4b4529ded35695d92ea98f989e;hpb=67a0a4de0e7d0b76e4bd6e1727da7802bb77fcf7;p=creaToolsTools.git diff --git a/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat b/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat index cd24ef5..2f5f5b4 100644 --- a/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat +++ b/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat @@ -18,8 +18,8 @@ echo ----End Asking Architecture-------- set thirdpartyGeneration=%1 set buildType=%2 - -set version="3.0.1-win32" +::The following line is to force x86 or x64 compilation +set x86Comp=%3 set thirdparty_cmake=%cd%\..\cmake @@ -28,7 +28,6 @@ set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall. set thirdpartylibpath=%thirdpartyGeneration%\thirdparty_temp\creaThirdParty_libraries set sourcepath=%thirdparty_cmake%\crea_ThirdParty_Libraries set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%\creaTPLBin -set installpath="ProgramFilesPath_x86\creatools\crea_ThirdParty_Libraries" if not exist %vcvarsall% set zipPath="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" if not exist %vcvarsall% ( @@ -36,32 +35,41 @@ if not exist %vcvarsall% ( exit ) -if %PROCESSOR_ARCHITECTURE%==x86 ( +if %x86Comp%==ON ( call %vcvarsall% + echo "Compilation forced x86" ) else ( - call %vcvarsall% amd64 + if %PROCESSOR_ARCHITECTURE%==x86 ( + set installpath="%ProgramFilesPath_x86%\creatools\crea_ThirdParty_Libraries" + call %vcvarsall% + ) else ( + set installpath="%ProgramFiles%\creatools\crea_ThirdParty_Libraries" + call %vcvarsall% amd64 + ) ) +rmdir /S /Q %binpath% mkdir %binpath% cd %binpath% -if %PROCESSOR_ARCHITECTURE%==x86 ( +if %x86Comp%==ON ( + set buildPlatform=win32 cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% ) else ( - cmake -G"Visual Studio 10 Win64" -H%sourcepath% -B%binpath% + if %PROCESSOR_ARCHITECTURE%==x86 ( + set buildPlatform=win32 + cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% + ) else ( + set buildPlatform=win64 + cmake -G"Visual Studio 10 Win64" -H%sourcepath% -B%binpath% + ) ) +cmake -D CREATOOLS_BUILDTYPE:STRING=%buildType% -D CREATOOLS_PLATFORM:STRING=%buildPlatform% CMakeCache.txt cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt cmake -D CREA_LIBRARY_SOURCE_PATH:PATH=%thirdpartylibpath% CMakeCache.txt cmake CMakeCache.txt FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% PACKAGE.vcxproj -set installerPath="%thirdpartydllspath%\thirdparty_bin\creaTPLBin\crea_ThirdParty_Libraries-%version%.exe" - -if exist installerPath ( -mkdir %thirdpartyGeneration%\thirdparty_installers -move /Y %installerPath% %thirdpartyGeneration%\thirdparty_installers -) - exit /B \ No newline at end of file