This is a tutorial on how to split a glademm project into subdirectories.  You might want to do this if your project is going to be at all big.  Maybe you have a dialog with a lot of handwritten code inside it, and you have decided to split it into multiple source files (maybe one for each class method), or maybe you have a lot of supporting classes, etc.

We will start with a simple step by step example.  This tutorial assumes that you know how to use glade-2 already and already understand the files glademm creates.  We are going to create a window and a dialog and put the dialog files in their own directory.
  1. Start glade-2
  2. Start a new gtk+ project
  3. In the project options, rename it to splitProject (if you do it in the project directory entry area, glade will change the rest of the fields for you), and set the language to  c++
  4. Add a toplevel window, and a top level dialog
  5. Inside each of those, place a button or label
  6. Save the project
  7. Build the project
  8. From this point forward you will be working from the command line and your favorite editor, so you can exit glade
  9. cd ~/Projects/splitProject/src
  10. mkdir dialog
  11. mv dialog* dialog/.
  12. cp Makefile.am dialog/.
  13. Edit ~/Projects/splitProject/src/Makefile.am:
    - Add the line: SUBDIRS = dialog above the bin_PROGRAMS line
    - Remove all references to the dialog source files from splitproject_SOURCES, and be sure the last source file now listed does not have a \ after it
    - Remove all references to the dialog source files from noinst_HEADERS, and be sure the last source file now listed does not have a \ after it
    - Add dialog/libdialog.a to the end of the splitproject_LDADD line
    - Add the line: INCLUDES = -Idialog to the end of the file
    - Save and exit
  14. cd dialog
  15. Edit ~/Projects/splitProject/src/dialog/Makefile.am:
    - Remove  the bin_PROGRAMS line, replace it with the line:  noinst_LIBRARIES=libdialog.a
    - Remove all references to the window and main program source files from splitproject_SOURCES, and be sure the last source file now listed does not have a \ after it
    - Remove all references to the window and main program files from noinst_HEADERS, and be sure the last source file now listed does not have a \ after it
    - Change splitproject_SOURCES to libdialog_a_SOURCES
    - Remove the splitproject_LDADD line
    - Save and exit
  16. cd ../..
  17. you are now in the top directory of the project, edit ~/Projects/splitProject/configure.in:
    - Modify the AC_OUTPUT line, by adding src/dialog/Makefile to it.  It should resemble:
    AC_OUTPUT(Makefile src/Makefile src/dialog/Makefile )
  18. ./autogen.sh
  19. make
  20. ./src/splitproject
You are now done.

author:  Mark Jones
no spam e-mail:  markDOT.jones106AT@verizonDOT.net
writen: Monday December 23, 2002
packages at time of writing: gtkmm-2.0.2, glade 1.1.3 (glade-2), glademm V1.1.3e_cvs, automake-1.4, autoconf-2.54