aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-02 08:56:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-02 08:56:43 +0200
commit0cdba22b3c9def33ed4f8844f3f455646b827f57 (patch)
tree66c6d586c9c98dfc61cc1ff29a54e2891ce528d5
parentf6b279095591b315c7498cb7e7efbdeb50a57bfa (diff)
Ignore subdirectories which already have a solution file
Also add support for the same-directory project/solution setup.
-rw-r--r--build/meta/vc10sln-functions.make2
-rw-r--r--build/meta/vc9sln-functions.make2
-rwxr-xr-xbuild/meta/vcsln62
3 files changed, 56 insertions, 10 deletions
diff --git a/build/meta/vc10sln-functions.make b/build/meta/vc10sln-functions.make
index a725279..b3553ef 100644
--- a/build/meta/vc10sln-functions.make
+++ b/build/meta/vc10sln-functions.make
@@ -27,4 +27,4 @@ $(src_root),,$(src_base)),$(if $3,$3,.vcxproj),$4,$5,$6,$7,$8,$9)
$(out_base)/%: meta-vc10sln-body = \
$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \
$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \
--b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1)
+-v 10 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1)
diff --git a/build/meta/vc9sln-functions.make b/build/meta/vc9sln-functions.make
index 26f9d9f..f781f99 100644
--- a/build/meta/vc9sln-functions.make
+++ b/build/meta/vc9sln-functions.make
@@ -27,4 +27,4 @@ $(src_root),,$(src_base)),$(if $3,$3,.vcproj),$4,$5,$6,$7,$8,$9)
$(out_base)/%: meta-vc9sln-body = \
$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \
$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \
--b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1)
+-v 9 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1)
diff --git a/build/meta/vcsln b/build/meta/vcsln
index c074580..8914a96 100755
--- a/build/meta/vcsln
+++ b/build/meta/vcsln
@@ -12,6 +12,7 @@
# -b <base-dir>
# -o <output-file>
# -e <project-ext>
+# -v <vc-version> {9, 10}
#
# Arguments:
#
@@ -27,6 +28,7 @@ function error ()
base=
output=
projext=
+vcver=
while [ $# -gt 0 ]; do
case $1 in
@@ -42,6 +44,10 @@ while [ $# -gt 0 ]; do
projext=$2
shift 2
;;
+ -v)
+ vcver=$2
+ shift 2
+ ;;
*)
break
;;
@@ -70,6 +76,11 @@ if [ "$projext" = "" ]; then
exit 1
fi
+if [ "$vcver" = "" ]; then
+ error "no VC++ version"
+ exit 1
+fi
+
m4=m4
u2d=unix2dos
@@ -80,17 +91,50 @@ meta=`dirname $0`
build="$meta/.."
install=$build/install/install
-# Find all the solution files.
+# Find all the project files.
+#
+all_proj_files=`find $base -name '*'$projext`
+
+# Filter out subdirectories which already have solution files.
#
-proj_files=`find $base -name '*'$projext`
-proj_names=`echo "$proj_files" | sed -e "s%^$base/\(.*\)/.*$%\1%"`
+proj_files=
+proj_names=
+for f in $all_proj_files; do
+ n=`echo "$f" | sed -e "s%^$base/\(.*\)/.*$%\1%"`
+
+ # If there is no sub-directory for this project, then use the
+ # root directory name.
+ #
+ if [ "$n" = "$f" ]; then
+ n=`basename $base`
+ d="."
+ else
+ d=$n
+ fi
+
+ while [ "$d" != "." ]; do
+ if ls $base/$d/*.sln >/dev/null 2>&1; then
+ break
+ fi
+ d=`dirname $d`
+ done
+
+ # If we din't find any solutions, then add this file to the list.
+ #
+ if [ "$d" = "." ]; then
+ proj_names="$proj_names $n"
+ proj_files="$proj_files $f"
+ fi
+done
# Determine available configurations and project uuids.
#
+conf=
+proj_uuids=
for f in $proj_files; do
if [ "$conf" = "" ]; then
- if [ "$projext" = ".vcproj" ]; then
+ if [ "$vcver" = "9" ]; then
conf=`cat $f | dos2unix | sed -n -e \
'/^[ ]*<Configuration$/{n;s/[ ]*Name="\([^"]*\)"$/"\1",/p};d' -`
conf=`echo $conf | sed -e 's/,$//'`
@@ -101,7 +145,7 @@ for f in $proj_files; do
fi
fi
- if [ "$projext" = ".vcproj" ]; then
+ if [ "$vcver" = "9" ]; then
uuid=`cat $f | dos2unix | sed -n -e \
's/^[ ]*ProjectGUID="{\([^}]*\)}"$/\1/p;d'`
else
@@ -116,10 +160,12 @@ for f in $proj_files; do
fi
done
-proj_files=`echo "$proj_files" | sed -e "s%^$base/%%"`
+proj_files=`echo $proj_files | sed -e "s%$base/%%g"`
-#echo $proj_names
-#echo $proj_uuids
+#error $proj_files
+#error $proj_names
+#error $proj_uuids
+#error $conf
export configurations=$conf
export project_files=$proj_files