Ignore:
Timestamp:
Mar 19, 2008, 11:59:41 AM (16 years ago)
Author:
garnier
Message:

QT moc remove before compiling

File:
1 edited

Legend:

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

    r726 r758  
    1 # $Id: common.gmk,v 1.44 2008/01/15 11:14:58 lgarnier Exp $
     1# $Id: common.gmk,v 1.50 2008/03/19 10:55:47 lgarnier Exp $
    22# ----------------------------------------------------------------
    33# Common part of GNUmakefile for libraries.  John Allison, 5/7/95.
     
    55# Libraries are created according to G4SYSTEM. G.Cosmo, 11/6/96.
    66# Introduced G4LIBDIR and G4TMPDIR. G.Cosmo, 23/6/98.
    7 # Introduced QT moc rule,L. Garnier 12/6/07.
     7# Introduced Qt moc rule, L.Garnier 15/2/08.
    88
    99ifndef G4LIBDIR
     
    1414moc_inc = $(shell grep -l "Q_OBJECT" include/*.hh )
    1515moc_files := $(patsubst include/%.hh, src/%_moc.cc, $(moc_inc))
    16 sources := $(wildcard src/*.cc)
    17 sources += $(moc_files)
     16
     17
     18ifeq ($(G4INTY_BUILD_QT),)
     19  # not so beautiful. In therory we should only remove theses files from sources
     20  sources := $(shell rm -f $(moc_files))
     21  sources := $(wildcard src/*.cc)
     22endif
     23
     24ifneq ($(G4INTY_BUILD_QT),)
     25  sources := $(wildcard src/*.cc)
     26  sources += $(moc_files)
     27endif
     28
     29
    1830objects := $(patsubst src/%.cc,$(G4TMPDIR)/%.o,$(sources))
    1931dependencies := $(patsubst src/%.cc,$(G4TMPDIR)/%.d,$(sources))
     
    6678###############################################################################
    6779#
    68 # Actual moc files for qt files
     80# Actual moc files for Qt files
    6981#
    7082# moc sources and headers: used for Qt signal/slot
    7183# - all headers which use signals/slots have the macro "Q_OBJECT" present
    72 in the class definitions; these all need to be processed by the
    73 "meta object compiler (moc)" which generates extra source code to
    74 implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
    75 it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is
     84 in the class definitions; these all need to be processed by the
     85 "meta object compiler (moc)" which generates extra source code to
     86 implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
     87 it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is
    7688#   just an arbitrary extension to make it easier to identify sources
    7789#   generated by moc).
    7890
     91ifneq ($(G4INTY_BUILD_QT),)
    7992src/%_moc.cc: include/%.hh
    8093        @echo Making moc file for $< ...
     
    8396        else $(QTMOC) $(MOC_MACRO) -o $@ $<; \
    8497        fi;
     98endif
     99
    85100
    86101###############################################################################
Note: See TracChangeset for help on using the changeset viewer.