summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-03-22 19:57:35 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-03-22 19:57:35 +0000
commite57237142b52591db501753687a287b7c07a4e1e (patch)
tree633d59da990bea1647535df2ac6c94b4745174f1 /qpid/cpp
parentffc2127898187ff6e8fafc61ce00a2145dc7c7ca (diff)
downloadqpid-python-e57237142b52591db501753687a287b7c07a4e1e.tar.gz
Get qpid source on the cmdline
Take an optional version string on cmdline Use a temporary install directory More work on following #install chains git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@926293 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/bld-winsdk.ps185
1 files changed, 68 insertions, 17 deletions
diff --git a/qpid/cpp/bld-winsdk.ps1 b/qpid/cpp/bld-winsdk.ps1
index d83b1be55f..e2fe888a3a 100644
--- a/qpid/cpp/bld-winsdk.ps1
+++ b/qpid/cpp/bld-winsdk.ps1
@@ -20,29 +20,77 @@
# This script requires cmake, and 7z to be already on the path devenv should be on the path as
# a result of installing Visual Studio
-# Filter to extract the include file from c style #include lines
+# Filter to extract the included files from c style #include lines
# TODO: Not used yet
-filter extractIncludes {
- Get-Content $_ |
- foreach {
- if ($_ -match '^\s*#include\s[<"]*(.*)[>"]\s*') {
- $matches[1]
+function extractIncludes {
+ param($includedir=".", $found=@{}, $notfound=@{})
+ process {
+ # Put original files in list if not already there
+ $file = $_.FullName
+ if (!($found.Contains($file))) {
+ $found[$file] = $true;
}
- } |
- sort -unique
+ $content = Get-Content $_
+ $filebase = $_.PSParentPath
+ $content | foreach {
+ if ($_ -match '^\s*#include\s*([<"])([^">]*)([>"])\s*') {
+ $included=$matches[2]
+ # Try to find the corresponding file in the same directory
+ # as the including file then try the include dir
+ $testpathf=Join-Path $filebase $included
+ $testpathi=Join-Path $includedir $included
+ if (Test-Path $testpathf) {
+ $includedfile = Get-Item $testpathf
+ } elseif (Test-Path $testpathi) {
+ $includedfile = Get-Item $testpathi
+ } else {
+ $notfound[$included] = $file
+ continue;
+ }
+ if (!($found.Contains($includedfile.FullName))) {
+ $found[$includedfile.FullName] = $file
+ $includedfile
+ }
+ }
+ }
+ }
}
-foreach ($arg in $args) {"Arg: $arg"}
+function getIncludeFiles {
+ param($base, $findall=$false)
+ if ($findall) {
+ Get-ChildItem -recurse -include *.h $base
+ } else {
+ foreach ($path in $input) {
+ $full=Join-Path $base $path
+ if (Test-Path $full) {
+ Get-Item $full
+ }
+ }
+ }
+}
+
+if ($args.length -lt 1) {
+ Write-Host 'Need to specify location of qpid src tree'
+ exit
+}
+
+$qpid_src=$args[0]
+$ver=$args[1]
+if ($ver -eq $null) {
+ $qpid_version_file="$qpid_src\QPID_VERSION.txt"
+
+ if ( !(Test-Path $qpid_version_file)) {
+ Write-Host "Path doesn't seem to be a qpid src tree (no QPID_VERSION.txt)"
+ exit
+ }
+ $ver=Get-Content $qpid_version_file
+}
-$qpid_src='..\qpid'
$qpid_cpp_src="$qpid_src\cpp"
-$install_dir='install_dir'
-$ver=Get-Content "$qpid_src/QPID_VERSION.txt"
+$install_dir="install_$([System.IO.Path]::GetRandomFileName())"
$zipfile="qpid-cpp-$ver.zip"
-# Clean out install directory
-Remove-Item -recurse $install_dir
-
# This assumes Visual Studio 2008
cmake -G "Visual Studio 9 2008" "-DCMAKE_INSTALL_PREFIX=$install_dir" $qpid_cpp_src
@@ -65,6 +113,9 @@ foreach ($pattern in $removable) {
# It would be very good to cut down on the shipped boost include files too, ideally by
# starting with the qpid files and recursively noting all boost headers actually needed
-# Createza new zip
-Remove-Item $zipfile
+# Create a new zip
+if (Test-Path $zipfile) {Remove-Item $zipfile}
&'7z' a $zipfile ".\$install_dir\*"
+
+# Remove temporary install area
+# Remove-Item -recurse $install_dir