Project 1 Setup on Mac OS X

Thanks to Jimmy Zhang for putting this together.

  1. If you don't have a C++ compiler, install that first. I would look into the GNU C++ compiler

    If you've taken 303, you probably have a C/C++ compiler already (if you didn't work on the linux machines in lab). Otherwise, I'm not going to get into the details of C++ setup.

  2. Set up SVN on your machine. Apparently there's many ways to do this. What I did was go to Collabnet.

    Then I downloaded Universal Subversion Binaries for my machine. Collabnet requires a login (boo) but I signed up because it seemed like a legit website (yay), plus if you're planning on working in the computing industry you'll probably be signing up for many forums anyways, so.

    Follow the instructions.

  3. (Optional) Get yourself a GUI for subversion. A very awesome one I've found for OS X is called Versions (google it). It costs money but it's worth not remembering extra svn commands from the terminal.

  4. Set up a working copy from the base repository, found here:
    svn+ssh://YOUR_NET_ID@attu.cs.washington.edu/projects/instr/CurrentQtr/cse457/impressionist/YOUR_GROUP_NAME/source

  5. Change up impressionist.pro in the source directory of your project.

    The line that says:
    mac:INCLUDEPATH += /usr/local/include/FL/images "file dialog"

    should be changed to:
    mac:INCLUDEPATH += ../FLTK ../FLTK/png ../FLTK/zlib ../FLTK/jpeg
    "file dialog"

    Also change up the line that says:
    mac:LIBS += -lfltk -lfltk_gl -lfltk_jpeg -lfltk_png -lfltk_images -l fltk_z -framework Carbon -framework ApplicationServices - framework AGL -framework OpenGL -framework AppKit

    To this:
    mac:LIBS += -L../FLTK/lib  -lfltk -lfltk_gl -lfltk_jpeg -lfltk_png -lfltk_images -l fltk_z -framework Carbon -framework ApplicationServices -framework AGL -framework OpenGL -framework AppKit

  6. Now go to the working copy of your project. Its time to build! First install FLTK. In my version of the project it was included inside the impressionist folder. View the README, agree with or mod paths. Then type:
    ./configure --enable-localjpeg --enable-localzlib --enable-localpng
    make

  7. Install Qt. Here's the relevant parts from the README distributed with the projects concerning Qt:

    In order to support cross platform builds we use Qt from Nokia, this is only necessary for Mac OS or Linux, but will work for windows machines also.

    Install the latest build of Qt (4.5.3 or greater) from http://qt.nokia.com/downloads and follow the instructions for Mac OS, Linux or Windows.

    for example, the URL for Mac OS - snow leopard is: http://qt.nokia.com/downloads/mac-os-cpp

    Install the source code to your directory (one location is ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-4.6.0.zip)

    Building Your Project With Qt

    In your project src directory run qmake this will create an XCode project on Macs, Makefiles under linux and windows.

    If you prefer makefiles on a mac, run:
    qmake -spec macx-g++42 -macx

  8. Now your make in the source directory should work. Or you've already made a XCodeProj in step 7 so you can build your project that way. I call it done from here on out, just make sure to only commit .cpp and .h files to the repos, or else your partner will pick up a corrupted Makefile and other config files that wouldn't work on his/her machine.