diff --git a/HACKING b/HACKING index 35e4e410..9ec1776f 100644 --- a/HACKING +++ b/HACKING @@ -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") @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..5ae60b43 --- /dev/null +++ b/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/ diff --git a/RTT_Client_GTK/src/RTT_Client_GTK.cpp b/RTT_Client_GTK/src/RTT_Client_GTK.cpp index e5d6404b..aa5cb3f2 100644 --- a/RTT_Client_GTK/src/RTT_Client_GTK.cpp +++ b/RTT_Client_GTK/src/RTT_Client_GTK.cpp @@ -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(); diff --git a/RTT_Client_GTK/src/RTT_Client_GTK.h b/RTT_Client_GTK/src/RTT_Client_GTK.h index 7ad36b4d..7fd87e6f 100644 --- a/RTT_Client_GTK/src/RTT_Client_GTK.h +++ b/RTT_Client_GTK/src/RTT_Client_GTK.h @@ -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 void *CallbackThread(void * parm);