From 0cdba22b3c9def33ed4f8844f3f455646b827f57 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Feb 2011 08:56:43 +0200 Subject: Ignore subdirectories which already have a solution file Also add support for the same-directory project/solution setup. --- build/meta/vc10sln-functions.make | 2 +- build/meta/vc9sln-functions.make | 2 +- build/meta/vcsln | 62 ++++++++++++++++++++++++++++++++++----- 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 # -o # -e +# -v {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 \ '/^[ ]*