From 0775cf4567ad0610f33e0030b961e32c845382f5 Mon Sep 17 00:00:00 2001 From: Fernando Cacciola Date: Wed, 11 Apr 2007 20:13:26 +0000 Subject: [PATCH] C2vcproj script fixed to better handle multiproject solutions --- wininst/changes.txt | 4 +++ wininst/developer_scripts/examples/C2vcproj | 31 ++++++++++--------- .../examples/master_71.vcproj | 8 ++--- .../examples/master_80.vcproj | 8 ++--- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/wininst/changes.txt b/wininst/changes.txt index 78b9ae36459..230e87d0370 100644 --- a/wininst/changes.txt +++ b/wininst/changes.txt @@ -1,3 +1,7 @@ +28 March 2007 Fernando Cacciola +- C2vcproj modified to produce _VC71.sln and _VC80.sln in the package folder, + then subfolders VC71 and VC80 each containing one .vcproj per main program. + 12 March 2007 Andreas Fabri - Removed cgal_confog.bat diff --git a/wininst/developer_scripts/examples/C2vcproj b/wininst/developer_scripts/examples/C2vcproj index 99cc0a9f1c2..3f59f28469c 100755 --- a/wininst/developer_scripts/examples/C2vcproj +++ b/wininst/developer_scripts/examples/C2vcproj @@ -26,22 +26,25 @@ create_project_file() projfile=`echo $srcfile|sed -e "s/\.$ext/\.vcproj/"`; # Creates a vcroj IFF it doesn't exist - if [ ! -e $projfile ]; then + if [[ ! -e $projfile ]]; then GUID=`printf "%012d" $RANDOM` - echo "Creating $projfile under VC$ver folder with GUID={00000000-0000-0000-0000-$GUID}" + outdir='$(ConfigurationName)_'$srcname + # # Takes a master .vcproj file, replaces the keywords # SOURCE for $srcname # EXT for $ext + # OUTDIR for $outdir # And moves the generated project file into the final folder # - sed -e"s/SOURCE/$srcname/g" $SCRIPTDIR/master_${ver}.vcproj > ./src2sln_/temp.txt; - sed -e"s/EXT/$ext/g" ./src2sln_/temp.txt > ./src2sln_/temp2.txt; - sed -e"s/ZZZZZZZZZZZZ/$GUID/g" ./src2sln_/temp2.txt > ./src2sln_/$projfile; + sed -e"s/SOURCE/$srcname/g" $SCRIPTDIR/master_${ver}.vcproj > ./src2sln_/temp.txt; + sed -e"s/EXT/$ext/g" ./src2sln_/temp.txt > ./src2sln_/temp2.txt; + sed -e"s/ZZZZZZZZZZZZ/$GUID/g" ./src2sln_/temp2.txt > ./src2sln_/temp3.txt; + sed -e"s/OUTDIR/$outdir/g" ./src2sln_/temp3.txt > ./src2sln_/$projfile; mv ./src2sln_/$projfile ./VC$ver; @@ -52,9 +55,9 @@ create_project_file() # And adds the line to parent solution file # echo "Adding $projfile to $slnfile" - sed -e"s/TARGET/$srcname/g" $SCRIPTDIR/master_${ver}_proj_line.sln > ./src2sln_/temp.txt; - sed -e"s/ZZZZZZZZZZZZ/$GUID/g" ./src2sln_/temp.txt > ./src2sln_/temp2.txt; - sed -e"s,PROJECT,VC$ver/$projfile,g" ./src2sln_/temp2.txt > ./src2sln_/temp3.txt; + sed -e"s/TARGET/$srcname/g" $SCRIPTDIR/master_${ver}_proj_line.sln > ./src2sln_/temp.txt; + sed -e"s/ZZZZZZZZZZZZ/$GUID/g" ./src2sln_/temp.txt > ./src2sln_/temp2.txt; + sed -e"s,PROJECT,VC$ver/$projfile,g" ./src2sln_/temp2.txt > ./src2sln_/temp3.txt; mv ./src2sln_/$slnfile ./src2sln_/$slnfile.tmp cat ./src2sln_/$slnfile.tmp ./src2sln_/temp3.txt > ./src2sln_/$slnfile @@ -74,24 +77,24 @@ create_project_file() # For each folder in parameters list for h in $@ ; do -if [ -d $h ]; then +if [[ -d $h ]]; then cd $h; echo "In " $h; pkg=`basename $h` # Create a VC71 subdirectory IFF it doesn't already exists - if [ ! -e "VC71" ]; then + if [[ ! -e "VC71" ]]; then mkdir VC71 fi # Create a VC80 subdirectory IFF it doesn't already exists - if [ ! -e "VC80" ]; then + if [[ ! -e "VC80" ]]; then mkdir VC80 fi # ALWAYS create temporary subdirectory "src2sln_" - if [ -e src2sln_ ]; then + if [[ -e src2sln_ ]]; then rm -r src2sln_; fi mkdir src2sln_; @@ -110,10 +113,10 @@ if [ -d $h ]; then # For each .C and .cpp file file for ext in C cpp ; do for i in *.$ext ; do - if [ ! $i = "*.$ext" ]; then + if [[ ! $i = "*.$ext" ]]; then # if $i contains a function "main()" zgrep main $i >/dev/null 2>&1 - if [ $? == 0 ]; then + if [[ $? == 0 ]]; then create_project_file $i $ext "71" $sp71 diff --git a/wininst/developer_scripts/examples/master_71.vcproj b/wininst/developer_scripts/examples/master_71.vcproj index dc9186d7dab..4895bf9e803 100644 --- a/wininst/developer_scripts/examples/master_71.vcproj +++ b/wininst/developer_scripts/examples/master_71.vcproj @@ -12,8 +12,8 @@ @@ -61,8 +61,8 @@ diff --git a/wininst/developer_scripts/examples/master_80.vcproj b/wininst/developer_scripts/examples/master_80.vcproj index 374b043ea1f..452a5dc5114 100644 --- a/wininst/developer_scripts/examples/master_80.vcproj +++ b/wininst/developer_scripts/examples/master_80.vcproj @@ -16,8 +16,8 @@