BOOST
This one was the hardest, mainly because you have to install it instead of just dragging it into the project. To install it (on mac) you can either use "MacPorts" via "sudo port install boost" or my terminal method. It's up to you wich method you pick. My terminal method I came up with is:
#!/bin/bash/
#BOOST INSTALL
clear
echo "### INSTALLING -> BOOST ###"
echo "---This part will take a while, and needs user participation"
cd ~/Downloads/
#see if the file is there to begin with, if it is skip the download part
if [ ! -d "boost_1_47_0" ]; then
echo "---A web browser will open up a website for you to download a"
echo "zip containing BOOST."
echo "---Please let it download to ~/Downloads/"
echo "---When the download has finished come back to this terminal for"
echo "--- further instructions."
echo "---Please press the enter button to commence..."
read
open "http://prdownloads.sourceforge.net/boost/boost_1_47_0.tar.gz"
echo "---Press the enter key when the download is"
echo "--- finished and when you are ready to proceed"
#wait for the user
read
#see if the file is there
if [ -f "boost_1_47_0.tar.gz" ]; then
echo "---Got the file, now continuing"
else
echo "---Could not find the file!"
exit
fi
tar -zxvf "boost_1_47_0.tar.gz"
else
echo "---You already have the tar.gz archive unzipped. Skipping the download"
fi
cd "boost_1_47_0"
echo "---I also need to use your password to install the library"
sudo chmod u+x bootstrap.sh
sudo chmod u+x ./tools/build/v2/engine/build.sh
echo "---Thank you"
echo "---This will take a while..."
sudo ./bootstrap.sh
#echo "---THIS WILL ALSO TAKE A LOOOOONG TIME..."
#sudo ./b2
echo "---ALMOST THERE..."
sudo ./bjam architecture=combined
echo "---DONE WITH INSTALLING BOOST!"
echo "...press enter to continue on with your life..."
read
clear
#END BOOST INSTALL
The terminal code is not the best in the world, but it does its job. And quite nicely. Well now comes part two, which changes if you decide to use g++/make or Xcode. In g++, you have to specify the libraries you are going to compile with, those commands are: -lboost_filesystem -lboost_system. The full makefile should look similar to:
CC = g++
CFLAGS = -Wall
PROG = game
SRCS := $(patsubst %.cpp,%.o,$(wildcard *.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*/*.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*/*/*.c*))
COMPILE = $(CC) $(CFLAGS) -c
ifeq ($(shell uname),Darwin)
LIBS = -framework OpenGL -framework GLUT -framework CoreFoundation
else
LIBS = -lglut
endif
all: $(PROG)
$(PROG): $(SRCS)
$(CC) $(CFLAGS) -lboost_filesystem -lboost_system -o $(PROG) $(SRCS) $(LIBS)
clean:
rm -f $(PROG)
rm -f *.o
rm -f */*.o
rm -f */*/*.o
rm -f */*/*/*.o
%.o: %.cpp
$(COMPILE) -o $@ $<
No comments:
Post a Comment