Replace tinyxml2_LIBRARY with tinyxml2_LIBRARIES#3897
Conversation
|
Will take a proper look tomorrow. It seems like the variable is actually called I assume my platform does not supply the pkg-config for tinyxml2 so it fell through to the |
|
It seems I was correct about the incorrect variable name. From https://cmake.org/cmake/help/latest/module/FindPkgConfig.html: So if you could adjust your patch to just replace |
|
Yes, I have pkg-config for tinyxml2 on my build platform, so it was not going to find_library at all. However, If I replace |
|
The "common" variable is This was just a simple typo which never caused an issue so far since we didn't actually used the library variable for
This was just reported by several package maintainers after the release. |
|
OK. I got your point. In fact I got confused, because find_package is for external projects, not for pkg-config (e.g. pkg_search_module), so find_library was not skipped. I just finished testing the changes and I'll push them shortly. |
I'm package maintainer myself :-) I just meant that the commit missed the release, but I hope there would be another a new one soon, so we (maintainers) do not have to deal with patches. |
@danmar sometimes does point releases (and he already did 2.7.1) so maybe this and 974dd5d could be cherry-picked into the next one.
You forgot to adjust the files in the |
I only found the |
cmake/printInfo.cmake
Outdated
| message( STATUS "USE_BUNDLED_TINYXML2 = ${USE_BUNDLED_TINYXML2}" ) | ||
| if (NOT USE_BUNDLED_TINYXML2) | ||
| message(STATUS "tinyxml2_LIBRARY = ${tinyxml2_LIBRARY}") | ||
| message(STATUS "tinyxml2_LIBRARY = ${tinyxml2_LIBRARIES}") |
There was a problem hiding this comment.
tinyxml2_LIBRARY -> tinyxml2_LIBRARIES
The |
Still missing that change in that file - hence the build failures. |
|
OK. I had to dug deeper to understand the problem. First, yesterday when I tested the changes I forgot to clear CMake cache, so the successful result was bogus. My bad, lesson learned. Then, it turns out TinyXML2 installs A normal find_package should set |
Yup. Thanks. Will merge if the build is successful. But I guess we should adjust the title of the PR before so it actually reflects what was done. |
|
The builds should pass. Please, adjust the title as you find appropriate. |
I was not able to report an issue, so I use this pull request to report the problem and hopefully solve it together.
Building cppcheck 2.7 with system's tinyxml2 library (i.e. setting
USE_BUNDLED_TINYXML2=OFF) fails with the following:I found and applied the changes from commit 974dd5d (which was made the day after 2.7 release BTW), but build still fails for "undefined symbols" from TinyXML2, because the library is not linked (no
-ltinyxml2) to several targets. The reason for this seams to be that variabletinyxml2_LIBRARYis not defined (see cmake/findDependencies.cmake:51).I therefore simply replaced the variable just to be able to build. However, the correct solution should be to properly define
tinyxml2_LIBRARYfor which I thinkfind_library(tinyxml2_LIBRARY tinyxml2)should be called also whentinyxml2package is found. Let me know what you think and I'll update the PR.