Skip to content

Commit

Permalink
General/GTK: Created global makefile
Browse files Browse the repository at this point in the history
- Added instructions in HACKING file
- Added support for distant .glade file in GTK
  • Loading branch information
AltF4 committed Feb 3, 2012
1 parent 8b13f97 commit 5d1d720
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 18 deletions.
51 changes: 34 additions & 17 deletions HACKING
Expand Up @@ -2,9 +2,30 @@
Building from source:
#######################

###########
Eclipse:
###########
#############
Dependencies:
#############

RTT depends on a few packages that are easily available through the Ubuntu repositories:

sudo apt-get install libsparsehash-dev libgtkmm-3.0-dev libois-dev libssl-dev

########################
OGRE 3D
########################

The version of OGRE in the default Ubuntu repositories is old / incomplete. So
instead, we use the offical OGRE PPA, avaialble form here:

https://launchpad.net/~ogre-team/+archive/ogre

Also, we require (for now) the OGRE sample media packs:

sudo apt-get install ogre-samples-media ogre-samples-source

###########################
Building Using Eclipse:
###########################

We use Eclipse as an IDE, and it is strongly recommended if you want to proceed. Unfortunately, the version in the Ubuntu repositories is rather old. So go and grab the latest from the web. Make sure it is the Eclipse CDT. (Not the one marked "for Linux developers")

Expand All @@ -31,23 +52,19 @@ Go to Help-> Marketplace->
Then search for "pkg-config" and it should come up. Hit
the install button and it will just work.

#############
Dependencies:
#############
###########################
Building Not Using Eclipse:
###########################

RTT depends on a few packages that are easily available through the Ubuntu repositories:
Just navigate to the main directory (where this file is located) and run:

sudo apt-get install libsparsehash-dev libgtkmm-3.0-dev libois-dev libssl-dev
make
sudo make install

########################
OGRE 3D
########################

The version of OGRE in the default Ubuntu repositories is old / incomplete. So
instead, we use the offical OGRE PPA, avaialble form here:
If you make changes, you may need to clean the source code in order to have it build properly again:

https://launchpad.net/~ogre-team/+archive/ogre
make clean

Also, we require (for now) the OGRE sample media packs:
If you want to uninstall the program:

sudo apt-get install ogre-samples-media ogre-samples-source
make uninstall
28 changes: 28 additions & 0 deletions Makefile
@@ -0,0 +1,28 @@
all: debug

debug:
cd RTT_Common/Debug; $(MAKE)
cd RTT_Server/Debug; $(MAKE)
cd RTT_Client_Core/Debug; $(MAKE)
cd RTT_Client_GTK/Debug; $(MAKE)
cd RTT_Ogre_3D/Debug; $(MAKE)

clean:
cd RTT_Common/Debug; $(MAKE) clean
cd RTT_Server/Debug; $(MAKE) clean
cd RTT_Client_Core/Debug; $(MAKE) clean
cd RTT_Client_GTK/Debug; $(MAKE) clean
cd RTT_Ogre_3D/Debug; $(MAKE) clean

install:
install RTT_Client_Core/Debug/libRTT_Client_Core.so $(DESTDIR)/usr/lib/
install RTT_Client_GTK/Debug/RTT_Client_GTK $(DESTDIR)/usr/bin/
install RTT_Server/Debug/RTT_Server $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/RTT/GTK/UI/
install RTT_Client_GTK/UI/* $(DESTDIR)/usr/share/RTT/GTK/UI/ --mode=644

uninstall:
rm -f $(DESTDIR)/usr/lib/libRTT_Client_Core.so
rm -f $(DESTDIR)/usr/bin/RTT_Client_GTK
rm -f $(DESTDIR)/usr/bin/RTT_Server
rm -rf $(DESTDIR)/usr/share/RTT/
19 changes: 18 additions & 1 deletion RTT_Client_GTK/src/RTT_Client_GTK.cpp
Expand Up @@ -18,7 +18,24 @@ int main( int argc, char **argv)
Main kit(argc, argv);

refBuilder = Gtk::Builder::create();
refBuilder->add_from_file("UI/WelcomeWindow.glade");
try
{
refBuilder->add_from_file(WELCOME_WINDOW_GLADE_PATH_USRSHARE);
}
catch(Glib::FileError error)
{
cerr << "WARNING: WelcomeWindow.glade not found in /usr/share/RTT/GTK/UI/";
try
{
refBuilder->add_from_file(WELCOME_WINDOW_GLADE_PATH_RELATIVE);
}
catch(Glib::FileError error)
{
cerr << "ERROR: WelcomeWindow.glade also not found in relative path UI/";
exit(EXIT_FAILURE);
}
}

refBuilder->get_widget_derived("window_welcome", window);

InitWidgets();
Expand Down
3 changes: 3 additions & 0 deletions RTT_Client_GTK/src/RTT_Client_GTK.h
Expand Up @@ -8,6 +8,9 @@
#ifndef RTT_CLIENT_GTK_H_
#define RTT_CLIENT_GTK_H_

#define WELCOME_WINDOW_GLADE_PATH_USRSHARE "/usr/share/RTT/GTK/UI/WelcomeWindow.glade"
#define WELCOME_WINDOW_GLADE_PATH_RELATIVE "UI/WelcomeWindow.glade"

#include <gtkmm.h>

void *CallbackThread(void * parm);
Expand Down

0 comments on commit 5d1d720

Please sign in to comment.