-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfltk_writer.sh
90 lines (62 loc) · 2 KB
/
fltk_writer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# //checking if wxmac is installed or not
# isPackageNotInstalled() {
# dpkg --status fltk &> /dev/null
# if [ $1 -eq 0 ]; then
# echo "fltk : Already installed "
# else
# echo "Please install fltk from brew using 'brew install fltk'"
# brew install $1
# fi
# }
# isPackageNotInstalled fltk
echo "Enter Project Name : "
read mssg
# echo "$mssg"
curd=$(pwd)
if [ -z "$mssg" ]
then
echo "Project Name Cannot be Empty"
else
# Creating a Main Bundle folder
mkdir "/Users/$(whoami)/Desktop/Developer"
mkdir "/Users/$(whoami)/Desktop/Developer/$mssg.app"
cd "/Users/$(whoami)/Desktop/Developer/$mssg.app" # Created Bundle Directory
# echo "$(pwd) Path updated"
# Going to Content/Root folder
mkdir Contents
cd Contents
# Setting up all directory
mkdir MacOS
mkdir Resources
mkdir Library
touch Info.plist
echo "$curd/Icon.png"
cp "$curd/Icon.png" "/Users/$(whoami)/Desktop/Developer/$mssg.app/Contents/Resources"
cd "/Users/$(whoami)/Desktop/Developer/$mssg.app/Contents"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleName</key>
<string>$mssg</string>
<key>CFBundleExecutable</key>
<string>main</string>
<key>CFBundleIconFile</key>
<string>Icon.png</string>
<!-- <key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string></string>
</dict>
</array> -->
</dict>
</plist>" >> Info.plist
cd $curd/exeFile
# clang main.cpp -o main
g++ *.cpp `fltk-config --use-forms --use-gl --use-images --ldstaticflags --cxxflags` -o main
mv main "/Users/$(whoami)/Desktop/Developer/$mssg.app/Contents/MacOS"
echo "Bundle path is (Dont Update the Developer Folder Path) : /Users/$(whoami)/Desktop/Developer/"
echo "Project Set Up Completed Enjoy ;)"
fi