The old one from KDELibs4 times is used by several projects from
Frameworks, KDE Applications and Extragear.
Modernized according the current cmake coding style but it also
keeps compatibility with the old find module for now and should be
a drop-in replacement.
Details
Removed the bundled FindTaglib.cmake from kfilemetadata, kio-extras,
juk, amarok and rename and built them successfully.
Diff Detail
- Repository
- R240 Extra CMake Modules
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 12604 Build 12622: arc lint + arc unit
I'm not entirely sure about taglib-config on Windows and Android (can't test there), but similar to pkg-config I omitted the special casing. Tried to test this by moving taglib-config out of the way on Linux and a taglib install in default locations, which worked fine.
Certainly a good idea to have this in ECM, so that this mess can be sorted out once and for all...
find-modules/FindTaglib.cmake | ||
---|---|---|
56 | Here it says Taglib camelcase... | |
57 | And here it says TAGLIB uppercase. This can't be right, one of those needs to be adjusted. | |
80 | This will set the include dir to <PREFIX/include/taglib.... | |
84 | (.... this searches for it both ways, so it's unclear what the include dir will be --- with or without taglib at the end?) | |
94 | ... and this then adds another /taglib/ to the path. I've always had that problem with taglib. It's not clear to me if the C/C++ code should use #include <tag.h> or #include <taglib/tag.h> and therefore it's not clear whether the include path should contain the /taglib subdir or not. | |
129 | Why set both the CFLAGS and the include dir? That means having the -I twice in there. Line 80 assumes that the cflags will never contain other flags than -I. If it's not true, then line 80 is wrong... |
Where does this FindTaglib.cmake come from?
We should probably use the one from kio-extras, which got a bunch of fixes in the last months.
find-modules/FindTaglib.cmake | ||
---|---|---|
84 | BTW since then it was determined that applications should use <tag.h>, so you should NOT search for taglib/tag.h | |
94 | In light of the above, this should be ${Taglib_INCLUDE_DIRS}/taglib.h (though it's weird to use a plural form variable in such a way; there should probably be a singular form variable in this file, and then the plural one exported for users) |