Ignore:
Timestamp:
Dec 7, 2007, 2:57:31 PM (17 years ago)
Author:
garnier
Message:

premiere version de la correction du ticket #99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/config/common.gmk

    r593 r643  
    1111G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name)
    1212
     13all : moc ;
     14moc : lib ;
    1315sources := $(wildcard src/*.cc)
    1416objects := $(patsubst src/%.cc,$(G4TMPDIR)/%.o,$(sources))
     
    3335# Actual gmake targets.
    3436#
    35 
    3637lib: $(g4libraries_to_build)
    3738
     
    6263###############################################################################
    6364#
     65# Actual moc files for qt files
     66#
     67# moc sources and headers: used for Qt signal/slot constructs in ui code
     68# - all headers which use signals/slots have the macro "Q_OBJECT" present
     69#  in the class definitions; these all need to be processed by the
     70#  "meta object compiler (moc)" which generates extra source code to
     71#  implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
     72#  it will be used by moc to generate the file "foo.moc.cpp" (the .moc. is
     73#   just an arbitrary extension to make it easier to identify sources
     74#   generated by moc). Use 'grep -l' to list all the files containing the token
     75
     76MOC_HDRS = $(shell grep -l "Q_OBJECT" include/*.hh )
     77MOC_SRCS = $(patsubst include/%.hh, src/%_moc_tmp.cc, $(MOC_HDRS))
     78moc : $(MOC_SRCS)
     79
     80MOC = $(QTHOME)/bin/moc
     81
     82src/%_moc_tmp.cc: include/%.hh
     83        @echo Making moc file for $< ...
     84        @if [ `$(QTHOME)/bin/moc -v 2>&1 | grep "Qt 4" | wc -l ` -gt 0 ]; then \
     85        $(MOC) -o $@ $<;\
     86        else $(MOC) $(MOC_MACRO) -o $@ $<; \
     87        fi;
     88
     89#       @echo Making moc file for $< ...
     90#       @if [ `$(QTHOME)/bin/moc -v 2>&1 | grep "Qt 3" | wc -l ` -gt 0 ]; then \
     91#       @$(MOC) -o $@ $<;\
     92#       else @$(MOC) $(MOC_MACRO) -o $@ $<;
     93#       fi;
     94
     95###############################################################################
     96#
    6497# Actual targets for .o, .d files
    6598#
     
    69102        $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(OUT_OBJ)$(G4TMPDIR)/$(*F).o src/$*.cc
    70103else
    71         @echo Compiling $*.cc ...
     104        @echo Compiling $*.cc ... 
    72105        @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(OUT_OBJ)$(G4TMPDIR)/$(*F).o src/$*.cc
    73106endif
     
    104137
    105138$(G4TMPDIR)/%.d: src/%.cc
    106         @echo Making dependency for file $< ...
     139        @echo Making dependency for file $<
    107140        @if [ ! -d $(G4TMPDIR) ] ; then mkdir -p $(G4TMPDIR)  ;fi
    108141        @set -e;\
Note: See TracChangeset for help on using the changeset viewer.