source: trunk/geant4/config/moc.gmk @ 763

Last change on this file since 763 was 762, checked in by garnier, 16 years ago

ajout

File size: 1.9 KB
Line 
1# $Id: common.gmk,v 1.51 2008/04/04 10:35:20 gcosmo Exp $
2# ----------------------------------------------------------------
3# Common part of GNUmakefile for libraries.  John Allison, 5/7/95.
4# ----------------------------------------------------------------
5# Libraries are created according to G4SYSTEM. G.Cosmo, 11/6/96.
6# Introduced G4LIBDIR and G4TMPDIR. G.Cosmo, 23/6/98.
7# Introduced Qt moc rule, L.Garnier 15/2/08.
8
9ifndef G4LIBDIR
10  G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
11endif
12G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name)
13
14ifneq ($(G4INTY_BUILD_QT),)
15#  dirMoc := OpenGL
16  moc_dir_name := $(patsubst G4%_moc, ../%, $(name))
17  moc_inc := $(shell grep -l "Q_OBJECT" ../$(dirMoc)/include/*.hh)
18  moc_sources := $(patsubst ../$(dirMoc)/include/%.hh, src/%_moc.cc, $(moc_inc))
19
20#  moc_inc := $(shell grep -l "Q_OBJECT" $(moc_dir_name)/include/*.hh)
21#  moc_tst := $(shell ls -al $(moc_inc) >/Users/garnier/tst)
22#  moc_sources := $(patsubst $(moc_dir_name)/include/%.hh, src/%_moc.cc, $(moc_inc))
23endif
24
25
26###############################################################################
27#
28# Actual moc files for Qt files
29#
30# moc sources and headers: used for Qt signal/slot
31# - all headers which use signals/slots have the macro "Q_OBJECT" present
32#   in the class definitions; these all need to be processed by the
33#   "meta object compiler (moc)" which generates extra source code to
34#   implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
35#   it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is
36#   just an arbitrary extension to make it easier to identify sources
37#   generated by moc).
38
39
40ifneq ($(G4INTY_BUILD_QT),)
41src/%_moc.cc: include/%.hh
42        @echo Making moc file for $< ...
43        @if [ `$(QTHOME)/bin/moc -v 2>&1 | grep "Qt 3" | wc -l ` -gt 0 ]; then \
44        $(QTMOC) -o $@ $<;\
45        else $(QTMOC) $(MOC_MACRO) -o $@ $<; \
46        fi;
47
48src/%.cc: src/%_moc.cc
49        @echo Making toto $< ...
50        @if [ ! -d $(G4TMPDIR) ] ; then mkdir -p $(G4TMPDIR)  ;fi
51
52endif
Note: See TracBrowser for help on using the repository browser.