MantisBT - CMake
View Issue Details
0013904CMakeCMakepublic2013-02-09 17:182013-02-10 12:37
Nicholas Bishop 
Alex Neundorf 
normalminoralways
closedfixed 
Intel 64-bitFedora18
CMake 2.8.10.2 
 
0013904: CMAKE_AUTOMOC misses headers with ".hh" extension
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.

1) Untar automoc_bug.tar.gz
2) Run "cmake -G Unix\ Makefiles"
3) 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

4) Rename "main.hh" to "main.h"
5) Edit line 1 of "main.c" to include "main.h" instead of "main.hh"
6) Re-run "make"

This time make succeeds.
No tags attached.
gz automoc_bug.tar.gz (578) 2013-02-09 17:18
https://public.kitware.com/Bug/file/4640/automoc_bug.tar.gz
Issue History
2013-02-09 17:18Nicholas BishopNew Issue
2013-02-09 17:18Nicholas BishopFile Added: automoc_bug.tar.gz
2013-02-10 12:08Alex NeundorfAssigned To => Alex Neundorf
2013-02-10 12:08Alex NeundorfStatusnew => assigned
2013-02-10 12:37Alex NeundorfNote Added: 0032245
2013-02-10 12:37Alex NeundorfStatusassigned => closed
2013-02-10 12:37Alex NeundorfResolutionopen => fixed

Notes
(0032245)
Alex Neundorf   
2013-02-10 12:37   
Fixed with the UseMakefileHeaderExtensions branch in next.