From 1299de40a497216d824224365b2e08e2d78b6f4b Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Wed, 29 Jan 2014 18:24:44 +0000 Subject: NO-JIRA: Update configuration script to handle a PROTON_ROOT. Expose the cmake command lines as they are executed. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1562539 13f79535-47bb-0310-9956-ffa450edef68 --- .../cpp/bindings/qpid/dotnet/configure-windows.ps1 | 102 +++++++++++++++++---- 1 file changed, 85 insertions(+), 17 deletions(-) (limited to 'qpid/cpp/bindings') diff --git a/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 b/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 index e62e5e8bc3..4874899b7f 100644 --- a/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 +++ b/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 @@ -55,6 +55,10 @@ # - If a directory "looks like" is has already had CMake run in it # then this script skips running CMake again. # +# * User chooses to include Proton or not. +# +# - Proton is included by having variable PROTON_ROOT reference the +# directory where proton was installed. # # Prerequisites # @@ -143,6 +147,7 @@ $ErrorActionPreference='Stop' # $global:txtPath = '$env:PATH' $global:txtQR = '$env:QPID_BUILD_ROOT' +$global:txtPR = '$env:PROTON_ROOT' $global:txtWH = 'Write-Host' ############################# @@ -217,6 +222,37 @@ function SanityCheckBoostPath ($path=0) } +############################# +# SanityCheckProtonInstallPath +# A path is a "proton install path" if it contains +# both bin and include subdirectories. +# +function SanityCheckProtonInstallPath ($path=0) +{ + $result = $true + $displayPath = "" + + if ($path -ne $null) { + $displayPath = $path + + $toTest = ('include', 'bin') + foreach ($pattern in $toTest) { + $target = Join-Path $path $pattern + if (!(Test-Path -path $target)) { + $result = $false + } + } + } else { + $result = $false + } + + if (! $result) { + Write-Host "The path ""$displayPath"" does not appear to be a Proton install root path." + } + $result +} + + ############################# # SanityCheckBuildPath # A path is a "build path" if it contains @@ -264,14 +300,16 @@ function WriteDotnetBindingSlnLauncherPs1 [string] $nBits, [string] $outfileName, [string] $studioVersion, - [string] $studioSubdir + [string] $studioSubdir, + [string] $protonRoot ) $out = @("# # Launch $slnName in $studioVersion $vsPlatform ($nBits-bit) environment # -$global:txtPath = ""$boostRoot\lib;$global:txtPath"" +$global:txtPath = ""$protonRoot\bin;$boostRoot\lib;$global:txtPath"" $global:txtQR = ""$buildRoot"" +$global:txtPR = ""$protonRoot"" $global:txtWH ""Launch $slnName in $studioVersion $vsPlatform ($nBits-bit) environment."" $cppDir\bindings\qpid\dotnet\$vsSubdir\$slnName ") @@ -328,7 +366,8 @@ function WriteDotnetBindingEnvSetupBat [string] $outfileName, [string] $studioVersion, [string] $studioSubdir, - [string] $cmakeLine + [string] $cmakeLine, + [string] $protonRoot ) $out = @("@ECHO OFF @@ -344,8 +383,9 @@ REM The solution was generated with cmake command line: REM $cmakeLine ECHO %PATH% | FINDSTR /I boost > NUL IF %ERRORLEVEL% EQU 0 ECHO WARNING: Boost is defined in your path multiple times! -SET PATH=$boostRoot\lib;%PATH% +SET PATH=$protonRoot\bin;$boostRoot\lib;%PATH% SET QPID_BUILD_ROOT=$buildRoot +SET PROTON_ROOT=$protonRoot ECHO Environment set for $slnName $studioVersion $vsPlatform $nBits-bit development. ") Write-Host " $buildRoot\$outfileName" @@ -441,7 +481,7 @@ function SelectVisualStudioVersion { SelectVisualStudioVersion ############################# -# User dialog to get optional 32-bit boost and build paths +# User dialog to get optional 32-bit boost, proton, and build paths # $boost32 = Select-Folder -message "Select 32-bit BOOST_ROOT folder for $global:vsVersion build. Press CANCEL to skip 32-bit processing." @@ -456,6 +496,18 @@ if ($defined32) { $make32 = $false if ($defined32) { + $proton32folder = Select-Folder -message "Select 32-bit Proton install folder for $global:vsVersion build." + + $found = ($proton32folder -ne $null) -and ($proton32folder -ne '') + if ($found) { + $found = SanityCheckProtonInstallPath $proton32folder + } + if ($found) { + $proton32cmake = """-DPROTON_ROOT=$proton32folder""" + } else { + $proton32cmake = "" + } + $build32 = Select-Folder -message "Select 32-bit QPID_BUILD_ROOT folder for $global:vsVersion build." -path $projRoot $found = ($build32 -ne $null) -and ($build32 -ne '') @@ -472,7 +524,7 @@ if ($defined32) { } ############################# -# User dialog to get optional 64-bit boost and build paths +# User dialog to get optional 64-bit boost, proton, and build paths # $boost64 = Select-Folder -message "Select 64-bit BOOST_ROOT folder for $global:vsVersion build. Press CANCEL to skip 64-bit processing." @@ -486,6 +538,18 @@ if ($defined64) { $make64 = $false if ($defined64) { + $proton64folder = Select-Folder -message "Select 64-bit Proton install folder for $global:vsVersion build." + + $found = ($proton64folder -ne $null) -and ($proton64folder -ne '') + if ($found) { + $found = SanityCheckProtonInstallPath $proton64folder + } + if ($found) { + $proton64cmake = """-DPROTON_ROOT=$proton64folder""" + } else { + $proton64cmake = "" + } + $build64 = Select-Folder -message "Select 64-bit QPID_BUILD_ROOT folder for $global:vsVersion build." -path $projRoot $found = ($build64 -ne $null) -and ($build64 -ne '') @@ -508,10 +572,9 @@ if ($defined64) { # if ($make32) { cd "$build32" - Write-Host "Running 32-bit CMake in $build32 ..." - $global:cmakeCommandLine32 = "CMake -G ""$global:cmakeGenerator"" ""-DBUILD_DOCS=No"" ""-DCMAKE_INSTALL_PREFIX=install_x86"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost32"" $cppDir" - Write-Host "$global:cmakeCommadLine32" - CMake -G "$global:cmakeGenerator" "-DBUILD_DOCS=No" "-DCMAKE_INSTALL_PREFIX=install_x86" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost32" $cppDir + $global:cmakeCommandLine32 = "CMake -G ""$global:cmakeGenerator"" ""-DBUILD_DOCS=No"" ""-DCMAKE_INSTALL_PREFIX=install_$build32"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost32"" $proton32cmake $cppDir" + Write-Host "Running 32-bit CMake in $build32 : $global:cmakeCommandLine32" + CMake -G "$global:cmakeGenerator" "-DBUILD_DOCS=No" "-DCMAKE_INSTALL_PREFIX=install_$build32" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost32" $proton32cmake $cppDir } else { Write-Host "Skipped 32-bit CMake." } @@ -522,9 +585,10 @@ if ($make32) { if ($make64) { cd "$build64" Write-Host "Running 64-bit CMake in $build64" - $global:cmakeCommandLine64 = "CMake -G ""$global:cmakeGenerator Win64"" ""-DBUILD_DOCS=No"" ""-DCMAKE_INSTALL_PREFIX=install_x64"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost64"" $cppDir" - Write-Host "$global:cmakeCommadLine64" - CMake -G "$global:cmakeGenerator Win64" "-DBUILD_DOCS=No" "-DCMAKE_INSTALL_PREFIX=install_x64" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost64" $cppDir + $global:cmakeCommandLine64 = "CMake -G ""$global:cmakeGenerator Win64"" ""-DBUILD_DOCS=No"" ""-DCMAKE_INSTALL_PREFIX=install_$build64"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost64"" $proton64cmake $cppDir" + Write-Host $global:cmakeCommandLine64 + Write-Host "" + CMake -G "$global:cmakeGenerator Win64" "-DBUILD_DOCS=No" "-DCMAKE_INSTALL_PREFIX=install_$build64" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost64" $proton64cmake $cppDir } else { Write-Host "Skipped 64-bit CMake." } @@ -549,7 +613,8 @@ if ($defined32) { -nBits "32" ` -outfileName "start-devenv-messaging-$global:vsSubdir-x86-32bit.ps1" ` -studioVersion "$global:vsVersion" ` - -studioSubdir "$global:vsSubdir" + -studioSubdir "$global:vsSubdir" ` + -protonRoot "$proton32folder" ########### @@ -577,7 +642,8 @@ if ($defined32) { -outfileName "setenv-messaging-$global:vsSubdir-x86-32bit.bat" ` -studioVersion "$global:vsVersion" ` -studioSubdir "$global:vsSubdir" ` - -cmakeLine "$global:cmakeCommandLine32" + -cmakeLine "$global:cmakeCommandLine32" ` + -protonRoot "$proton32folder" } else { Write-Host "Skipped writing 32-bit scripts." @@ -615,7 +681,8 @@ if ($defined64) { -psScriptName "start-devenv-messaging-$global:vsSubdir-x64-64bit.ps1" ` -outfileName "start-devenv-messaging-$global:vsSubdir-x64-64bit.bat" ` -studioVersion "$global:vsVersion" ` - -studioSubdir "$global:vsSubdir" + -studioSubdir "$global:vsSubdir" ` + -protonRoot "$proton64folder" ########### # Batch script (that you CALL from a command prompt) @@ -629,7 +696,8 @@ if ($defined64) { -outfileName "setenv-messaging-$global:vsSubdir-x64-64bit.bat" ` -studioVersion "$global:vsVersion" ` -studioSubdir "$global:vsSubdir" ` - -cmakeLine "$global:cmakeCommandLine64" + -cmakeLine "$global:cmakeCommandLine64" ` + -protonRoot "$proton64folder" } else { Write-Host "Skipped writing 64-bit scripts." -- cgit v1.2.1