GNOME Bugzilla – Bug 626033
EXTENSION_MAPPING not working when redefining default extensions
Last modified: 2010-08-19 19:10:41 UTC
I have developped a perl script which transforms .m (Matlab files) into .cpp files. I have then defined the EXTENSION_MAPPING (in the Doxyfile) as described in the documentation, that is : EXTENSION_MAPPING=m=C++ Unfortunately, this syntax was not working. Looking into the code, I discover that .m files are associated with objective-c language (see the file util.cpp, line 6484 in the initDefaultExtensionMapping function) : updateLanguageMapping(".m", "objective-c"); If the EXTENSION_MAPPING is redefined, the updateLanguageMapping function is called but without the dot in the extension (see the file doxygen.cpp, line 9560). Setting EXTENSION_MAPPING to m=C++ leads to : updateLanguageMapping("m", "C++") (note the missing dot in the "m") The preceding association between .m file and objective-c won't be replaced by the new one as expected, because extension .m and m are not considered to be the same extension : the map g_extLookup (see function updateLanguageMapping in file util.cpp) will contain for m files : { ... {'.m', SrcLangExt_ObjC}, {'m', SrcLangExt_Cpp} ... } And following calls to getLanguageFromFileName will still lead to associate .m files with Objective-C. As a workaround, we can modify the EXTENSION_MAPPING that way : EXTENSION_MAPPING=.m=C++ (note the dot before the 'm') Doxygen behaves then as expected but : - this is not correct regarding to the documentation - Doxygen outputs : "Adding custom extension mapping: ..m will be treated as language c++" (note the two dots before the 'm') See also bug #567774 describing a similar problem.
That's the same issue indeed. *** This bug has been marked as a duplicate of bug 567774 ***