[glade--]Re: subdirs

Christof Petig <[email protected]>
Newsgroups gmane.comp.gnome.glademm
Organization Adolf Petig GmbH & Co. KG
Message-ID <[email protected]>
Mark Jones schrieb:
> Perhaps it might be best to start with something much simpler...how to
> do it from a new project (and then doing it to an existing project with
> lots of handcoded files might be easier).  Maybe we can write a tutorial
> that could be put on the glade-- page.

I'll happily accept any submissions. But I think I'm too far away from 
beginners problems to even guess them.

> 
> Here is what I have tried so far (unsuccessfuly)
> - from glade-2, start a new project
> - add a window
> - add a dialog
> - add a label to each
> - go to options, set to c++, note project directory
> - save, then build
> - from command prompt, enter project directory
> - enter src directory, lets make dialog files be in a subdir
> - mkdir dialog
> - mv dialog* dialog/.
> - cp Makefile.am dialog/.
> - edit Makefile.am, remove all references to dialog files, add SUBDIRS
> line:  SUBDIRS = dialog, add INCLUDES LINE
> 
> Should now look like:
> ----------------------------------------------
> SUBDIRS = dialog
> 
> bin_PROGRAMS = project32
> 
> project32_SOURCES = \
> 	project32.cc\
> 	window1_glade.cc \
> 	window1.cc

You need to specify the subdir files as well. Perhaps this way: (see below)

> 
> noinst_HEADERS = \
> 	window1_glade.hh \
> 	window1.hh 
> 
> CXXFLAGS = @CXXFLAGS@ @GTKMM_CFLAGS@
> 
> project32_LDADD = @LIBS@ @GTKMM_LIBS@

project32_LDADD = @LIBS@ dialog/libdialog.a @GTKMM_LIBS@

> 
> INCLUDES = -Idialog
> ----------------------------------------------
> 
> - edit dialog/Makefile.am, remove all references to other files, those
> in src, and remove bin_PROGRAMS line
> 
> Should now look like:
> ----------------------------------------------
> project32_SOURCES = \

please try instead

noinst_LIBRARIES=libdialog.a

LIBDIALOG_A_SOURCES = \
> 	dialog1_glade.cc \
> 	dialog1.cc 
> 
> noinst_HEADERS = \
> 	dialog1_glade.hh \
> 	dialog1.hh 
> 
> CXXFLAGS = @CXXFLAGS@ @GTKMM_CFLAGS@
> 
> project32_LDADD = @LIBS@ @GTKMM_LIBS@
omit this line
> ----------------------------------------------
> 
> - edit project32/configure.in, add src/dialog/Makefile to AC_OUTPUT line
> 
> Should now look like:
> ----------------------------------------------
> AC_INIT(src/project32.cc)
> AM_INIT_AUTOMAKE(project32, 0.0)
> AM_CONFIG_HEADER(config.h)
> 
> AC_ISC_POSIX
> AC_PROG_CC
> AM_PROG_CC_STDC
> AC_HEADER_STDC
> AC_PROG_CPP
> AC_PROG_CXX
> AC_PROG_CXXCPP
> AM_PROG_LIBTOOL
> 
> AC_LANG_CPLUSPLUS
> 
> PKG_CHECK_MODULES(GTKMM,[gtkmm-2.0 >= 2.0.2])
> AC_SUBST(GTKMM_CFLAGS)
> AC_SUBST(GTKMM_LIBS)
> 
> AC_OUTPUT(Makefile src/Makefile src/dialog/Makefile )

perfect.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.