Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have a Makefile.am setup much like what follows in order to compile MOC files for Qt using Autotools. I think it may have something to do with not finding the headers as they are located outside of the directory which is compiling the cpp files.
- ---
- bin_PROGRAMS = test
- test_qtheaders = window.h
- test_moc_sources = $(test_qtheaders:.h=_moc.cpp)
- test_SOURCES = \
- main.cpp \
- main-window.cpp \
- window.cpp \
- $(test_moc_sources)
- test_CPPFLAGS = -I/usr/include -I/usr/local/include -I$(QT5_INCL) -I$(QT5_INCL)/QtWidgets -I$(QT5_INCL)/QtCore
- test_LDFLAGS = -L/usr/lib64 -L/usr/local/lib64 -L/usr/local/lib -L$(QT5_LIBS)
- test_LDADD = -lrt -lQt5Core -lQt5Gui -lQt5Widgets
- SUFFIXES = .h _moc.cpp
- # problem here, not able to find where the *.h file is as it's not in the current directory.
- .h_moc.cpp:
- $(QT_MOC) -o $@ $(test_CPPFLAGS) $(CPPFLAGS) $<
- ---
- I get the following error.
- make[4]: *** No rule to make target 'window_moc.cpp', needed by 'test-window_moc.o'. Stop.
- My directory structure appears as follows:
- myproj
- |- configure.ac
- |- Makefile.am
- |- ...
- ` src
- |- Makefile.am
- |- includes
- | `- gui
- | |- main-window.h
- | `- window.h // MOC source file used to generate *.cpp.
- |
- `- gui
- |- Makefile.am
- |- main.cpp
- |- main-window.cpp
- `- window.cpp // MOC file yet to be generated, does not yet exist before build.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement