C2vcproj script fixed to better handle multiproject solutions

This commit is contained in:
Fernando Cacciola 2007-04-11 20:13:26 +00:00
parent 284081de7d
commit 0775cf4567
4 changed files with 29 additions and 22 deletions

View File

@ -1,3 +1,7 @@
28 March 2007 Fernando Cacciola
- C2vcproj modified to produce <package>_VC71.sln and <package>_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

View File

@ -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

View File

@ -12,8 +12,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
OutputDirectory="OUTDIR"
IntermediateDirectory="OUTDIR"
ConfigurationType="1"
CharacterSet="2"
ManagedExtensions="FALSE">
@ -61,8 +61,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
OutputDirectory="OUTDIR"
IntermediateDirectory="OUTDIR"
ConfigurationType="1"
CharacterSet="2"
ManagedExtensions="FALSE">

View File

@ -16,8 +16,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
OutputDirectory="OUTDIR"
IntermediateDirectory="OUTDIR"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
@ -95,8 +95,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
OutputDirectory="OUTDIR"
IntermediateDirectory="OUTDIR"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"