Skip to content

Commit 3d60020

Browse files
authored
Merge pull request #43 from RyanVreeke/master
Updating Main Calvin-CS/TSGL from RyanVreeke/TSGL
2 parents 3c5e622 + 48ad015 commit 3d60020

479 files changed

Lines changed: 6977 additions & 16506 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
[submodule "docs"]
55
path = docs
66
url = git@github.com:Calvin-CS/TSGL.git
7-
branch = gh-pages
7+
branch = master

MacBinInstaller/TSGL.dmg

-624 Bytes
Binary file not shown.

install-mac renamed to MacBinInstaller/install-mac

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ fi
3636
if [ $(has brew) = 0 ]; then
3737
echo "Installing Homebrew..."
3838
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
39-
export PATH=/usr/local/bin:$PATH
39+
export PATH=/usr/bin:$PATH
4040
else
4141
echo "Homebrew detected."
42-
export PATH=/usr/local/bin:$PATH
42+
export PATH=/usr/bin:$PATH
4343
fi
4444

4545
echo
@@ -70,6 +70,40 @@ brew install doxygen
7070
echo "Installing cxxopts..."
7171
brew install cxxopts
7272

73+
#glm
74+
echo "Installing glm..."
75+
brew install glm
76+
77+
####################################################################################
78+
79+
#redefine path variable and append to bashrc
80+
tsglFile=/usr/local/lib/libtsgl.so
81+
82+
if [ -f "$tsglFile" ]
83+
then
84+
echo ""
85+
echo "export PATH=/usr/local/bin:$PATH" >> ~/.bashrc
86+
echo "export TSGL_HOME=/usr/local" >> ~/.bashrc
87+
echo "export TSGL_DEFAULT_FONT=/include/TSGL/assets/freefont/FreeSansBold.ttf" >> ~/.bashrc
88+
89+
source ~/.profile
90+
else
91+
echo ""
92+
fi
93+
94+
source ~/.profile
95+
#change the call for assets and LFLAG directory
96+
#cd src/examples
97+
#grep -rli '/usr/include/TSGL/assets' * | xargs perl -i -pe's|/usr/include/TSGL/assets|/usr/local/include/TSGL/assets|g'
98+
99+
#grep -rli 'L/usr/lib' * | xargs perl -pi -e 's|L/usr/lib|L/usr/local/lib|g'
100+
#cd -
101+
102+
#move stb to /usr/local/include
103+
#sudo cp -r stb /usr/local/include
104+
105+
####################################################################################
106+
73107
#g++
74108
gVers=$(g++ -v 2>&1)
75109
gVeres=$(g++ -v 2>&1 | grep "gcc version" | cut -f 3 -d ' ' | tr -d .)
@@ -79,30 +113,33 @@ echo "$gVers" | grep "clang" > check.txt
79113
version=490
80114

81115
#First, check if we need to move an existing g++ compiler
82-
if [ -e /usr/local/bin/g++ ] && [ ! -e /usr/local/Cellar/gcc49 ];
116+
if [ -e /usr/bin/g++ ] && [ ! -e /usr/Cellar/gcc49 ];
83117
then
84-
sudo mv /usr/local/bin/g++ /usr/local/bin/g++old
85-
sudo mv /usr/local/bin/gcc /usr/local/bin/gccold
86-
118+
echo ""
119+
#sudo mv /usr/bin/g++ /usr/bin/g++old
120+
#sudo mv /usr/bin/gcc /usr/bin/gccold
87121
fi
88122

89123
#Now check if we need to install gcc10
90124
if grep --quiet clang check.txt; then
91125
echo "Installing g++...this may take a while!"
92126
brew install gcc
93-
sudo rm /usr/local/bin/gcc
94-
sudo rm /usr/local/bin/g++
95-
sudo ln -s /usr/local/Cellar/gcc/10.2.0/bin/gcc-10 /usr/local/bin/gcc
96-
sudo ln -s /usr/local/Cellar/gcc/10.2.0/bin/g++-10 /usr/local/bin/g++
127+
#sudo rm /usr/bin/gcc
128+
#sudo rm /usr/bin/g++
129+
#sudo ln -s /usr/Cellar/gcc/10.2.0/bin/gcc-10 /usr/bin/gcc
130+
#sudo ln -s /usr/Cellar/gcc/10.2.0/bin/g++-10 /usr/bin/g++
97131
else
98132
echo "Installing g++...this may take a while!"
99133
brew install gcc
100-
sudo rm /usr/local/bin/gcc
101-
sudo rm /usr/local/bin/g++
102-
sudo ln -s /usr/local/Cellar/gcc/10.2.0/bin/gcc-10 /usr/local/bin/gcc
103-
sudo ln -s /usr/local/Cellar/gcc/10.2.0/bin/g++-10 /usr/local/bin/g++
134+
#sudo rm /usr/bin/gcc
135+
#sudo rm /usr/bin/g++
136+
#sudo ln -s /usr/Cellar/gcc/10.2.0/bin/gcc-10 /usr/bin/gcc
137+
#sudo ln -s /usr/Cellar/gcc/10.2.0/bin/g++-10 /usr/bin/g++
104138
fi
105139

140+
#delete check.txt
141+
rm check.txt
142+
106143
#Symlinks
107144
echo "Fixing missing symlinks..."
108145
if [ ! -e /usr/X11/lib/libX11.dylib ]; then
@@ -114,8 +151,8 @@ if [ ! -e /usr/X11/lib/libXrandr.dylib ]; then
114151
fi
115152

116153
#Remove any broken symlinks before installing
117-
sudo rm -f /usr/local/lib/libtsgl.*
118-
sudo rm -rf /usr/local/include/TSGL
154+
rm -f /usr/lib/libtsgl.*
155+
rm -rf /usr/include/TSGL
119156

120157
#Build TSGL and install
121158
echo "Building TSGL..."
@@ -131,4 +168,27 @@ sudo make install
131168
echo
132169

133170
echo "Installation complete!"
171+
172+
echo
173+
#checking update
174+
echo "Checking for updates..."
175+
176+
TSGL_VERSION=$(git describe --tags --abbrev=0)
177+
TSGL_LATEST_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
178+
179+
if [ $TSGL_VERSION < $TSGL_LATEST_VERSION ]
180+
then
181+
echo ""
182+
else
183+
echo "Latest version $TSGL_LATEST_VERSION found. WARNING, If you have changed anything in the TSGL folder it may be overwritten during update. To keep your changes, please commit them before updating."
184+
read -p "Do you want to install the update? This will replace all the files with the updated ones (y/n): " INPUT
185+
if [ $INPUT == y ] || [ $INPUT == Y ]
186+
then
187+
echo "Updating TSGL..."
188+
git remote add tsgl https://github.com/Calvin-CS/TSGL.git
189+
git pull tsgl master
190+
fi
191+
echo "Latest version already installed"
192+
fi
193+
134194
echo "Run \"./runtests\" to verify everything is working."

Makefile

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ AR=ar
77
CC=g++
88
RM=rm -f
99
INSTALL=/usr/bin/install
10-
PREFIX=/usr/local
1110

1211
SRC_PATH=src/TSGL/
1312
TESTS_PATH=src/tests/
@@ -45,31 +44,18 @@ ifeq ($(UNAME), Darwin)
4544
OS_EXTRA_LIB :=
4645
OS_GL :=
4746
OS_OMP := -fopenmp -lomp
48-
OS_COMPILER := -std=c++0x
47+
OS_COMPILER := -std=c++11
4948
endif
5049

51-
CXXFLAGS=-O3 -g3 -ggdb3 \
52-
-Wall -Wextra \
53-
-D__GXX_EXPERIMENTAL_CXX0X__ \
54-
-I/usr/local/include/Cellar/glfw3/3.3/include/ \
55-
-I${SRC_PATH}/ \
56-
-I/usr/include/ \
57-
-I/usr/local/include/ \
58-
-I/usr/local/include/freetype2 \
59-
-I/usr/local/include/freetype2/freetype \
60-
-I/opt/AMDAPP/include/ \
61-
-I/usr/include/c++/4.6/ \
62-
-I/usr/include/c++/4.6/x86_64-linux-gnu/ \
63-
-I/usr/lib/gcc/x86_64-linux-gnu/9/include/ \
64-
-I/usr/include/freetype2 \
65-
-I/usr/include/freetype2/freetype \
66-
-I./ \
67-
$(OS_COMPILER) -fopenmp \
68-
${NOWARN} -fpermissive
69-
# -pedantic-errors
50+
CXXFLAGS = -O3 -g3 -ggdb3 \
51+
-I$(TSGL_HOME)/include \
52+
-I${SRC_PATH} \
53+
-Isrc \
54+
-I$(TSGL_HOME)/include/freetype2 \
7055

7156
LFLAGS=-Llib/ \
72-
-L/usr/local/lib \
57+
-L/usr/lib \
58+
-L$(TSGL_HOME)/lib \
7359
${OS_EXTRA_LIB} \
7460
-L/usr/X11/lib/ \
7561
${OS_LDIRS} \
@@ -134,6 +120,9 @@ cleandocs:
134120

135121
# -include build/*.d
136122

123+
124+
PREFIX=$(prefix)
125+
137126
#install
138127
ifeq ($(UNAME), Linux)
139128
install:
@@ -143,6 +132,9 @@ install:
143132
install -m 0644 lib/libtsgl.a $(PREFIX)/lib
144133
install -m 0755 lib/libtsgl.so $(PREFIX)/lib
145134
cp -r src/TSGL $(PREFIX)/include
135+
cp src/tsgl.h $(PREFIX)/include
136+
cp -r assets/ $(PREFIX)/include/TSGL
137+
cp -r src/stb/ $(PREFIX)/include
146138
endif
147139
ifeq ($(UNAME), CYGWIN_NT-10.0)
148140
install:
@@ -152,6 +144,9 @@ install:
152144
install -m 0644 lib/libtsgl.a $(PREFIX)/lib
153145
install -m 0755 lib/libtsgl.dll $(PREFIX)/lib
154146
cp -r src/TSGL $(PREFIX)/include
147+
cp src/tsgl.h $(PREFIX)/include
148+
cp -r assets/ $(PREFIX)/include/TSGL
149+
cp -r src/stb/ $(PREFIX)/include
155150
endif
156151
ifeq ($(UNAME), Darwin)
157152
install:
@@ -161,7 +156,9 @@ install:
161156
install -m 0644 lib/libtsgl.a $(PREFIX)/lib
162157
install -m 0755 lib/libtsgl.so $(PREFIX)/lib
163158
cp -r src/TSGL $(PREFIX)/include
164-
cp -r stb $(PREFIX)/include
159+
cp src/tsgl.h $(PREFIX)/include
160+
cp -r src/stb $(PREFIX)/include
161+
cp -r assets $(PREFIX)/include/TSGL
165162
endif
166163

167164
build/build: ${HEADERS} ${SOURCES} ${TESTS}

0 commit comments

Comments
 (0)