mirror of https://github.com/CGAL/cgal
65 lines
2.0 KiB
Bash
Executable File
65 lines
2.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
#
|
|
# Create a .vcproj Visual C++ makefile for each .C and .cpp file
|
|
# Usage: C2vcproj folder1 ...
|
|
#
|
|
|
|
# For each folder in parameters list
|
|
for h in $@ ; do
|
|
if [ -d $h ]; then
|
|
cd $h;
|
|
echo "In " $h;
|
|
|
|
# Create temporary subdirectory "text"
|
|
if [ -e text ]; then
|
|
rm -r text;
|
|
fi
|
|
mkdir text;
|
|
|
|
# For each .C and .cpp file file
|
|
for ext in C cpp ; do
|
|
for i in *.$ext ; do
|
|
if [ ! $i = "*.$ext" ]; then
|
|
# if $i contains a function "main()"
|
|
zgrep main $i >/dev/null 2>&1
|
|
if [[ $? == 0 ]]; then
|
|
|
|
ofn=`echo $i|sed -e "s/\.$ext/\.exe/"`;
|
|
k=`echo $i|sed -e "s/\.$ext//"`;
|
|
|
|
# Create $jp VC++ 7.1 project file if it doesn't exist
|
|
jp=`echo $i|sed -e "s/\.$ext/\_71.vcproj/"`;
|
|
if [[ ! -e $jp ]]; then
|
|
echo "Creating $jp"
|
|
sed -e"s/master/$k/g" ../../developer_scripts/examples/master_71.vcproj > ./text/temp.txt;
|
|
sed -e"s/EXT/$ext/g" ./text/temp.txt > ./text/temp2.txt;
|
|
sed -e"s/test_msvc71.exe/$ofn/g" ./text/temp2.txt > ./text/temp3.txt;
|
|
sed -e"s/test_msvc71/$k/g" ./text/temp3.txt > ./text/$jp;
|
|
mv ./text/$jp ./;
|
|
rm -rf ./text/temp.txt ./text/temp2.txt ./text/temp3.txt
|
|
fi
|
|
|
|
# Create $jp VC++ 8.0 project file if it doesn't exist
|
|
jp=`echo $i|sed -e "s/\.$ext/\_80.vcproj/"`;
|
|
if [[ ! -e $jp ]]; then
|
|
echo "Creating $jp"
|
|
sed -e"s/master/$k/g" ../../developer_scripts/examples/master_80.vcproj > ./text/temp.txt;
|
|
sed -e"s/EXT/$ext/g" ./text/temp.txt > ./text/temp2.txt;
|
|
sed -e"s/test_msvc80.exe/$ofn/g" ./text/temp2.txt > ./text/temp3.txt;
|
|
sed -e"s/test_msvc80/$k/g" ./text/temp3.txt > ./text/$jp;
|
|
mv ./text/$jp ./;
|
|
rm -rf ./text/temp.txt ./text/temp2.txt ./text/temp3.txt
|
|
fi
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
|
|
# Remove temporary subdirectory "text"
|
|
rm -r text
|
|
|
|
cd ..;
|
|
fi
|
|
done
|