CMAKE_AUTOMOC misses headers with ".hh" extension
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Automoc fails to run on included headers with a ".hh" extension, works correctly if file is renamed with a ".h" extension.
A minimal example is attached: automoc_bug.tar.gz
- Untar automoc_bug.tar.gz
- Run "cmake -G Unix\ Makefiles"
- Run "make"
Make fails with:
CMakeFiles/a.dir/main.cc.o: In function `Foo::Foo()':
main.cc:(.text+0x3a): undefined reference to `vtable for Foo'
main.cc:(.text+0x46): undefined reference to `vtable for Foo'
CMakeFiles/a.dir/main.cc.o: In function `Foo::~Foo()':
main.cc:(.text._ZN3FooD2Ev[_ZN3FooD5Ev]+0x13): undefined reference to `vtable for Foo'
main.cc:(.text._ZN3FooD2Ev[_ZN3FooD5Ev]+0x1f): undefined reference to `vtable for Foo'
collect2: error: ld returned 1 exit status
make[2]: *** [a] Error 1
make[1]: *** [CMakeFiles/a.dir/all] Error 2
make: *** [all] Error 2
- Rename "main.hh" to "main.h"
- Edit line 1 of "main.c" to include "main.h" instead of "main.hh"
- Re-run "make"
This time make succeeds.
Edited by Brad King