[>=0.9.2] Does not detect too old version of Google Test
ryandesign opened this issue · comments
Hi,
uriparser 0.9.3 produces this output from cmake:
-- Found GTest: /opt/local/lib/libgtest.a (Required is at least version "1.8.1")
I actually had Google Test 1.8.0 installed, and it didn't detect that it was too old; it proceeded on to build the code and run the tests.
In fact the tests succeeded even with Google Test 1.8.0, so maybe 1.8.1 is not required after all.
Hi @ryandesign,
the version check is done by CMake and/or the CMake config module provided by GTest. I am unsure if I should add an explicit low-level checks on uriparser side in addition to only drop it again later — or worse — keep it around for quite some time.
1.8.1 was chosen in b3b3e20 because 1.8.0 did not do at the time of introduction where GNU autoconf and pkg-config were used for detection.
Unless you really need support for GTest 1.8.0 or waterproof rejection of <1.8.1 I'm tempted to close this ticket as good enough
. What do you think?
I don't need support for googletest 1.8.0; I'm just reporting to you that whatever version checking you're doing on googletest is not working.
Yes, and you're right in doing so!
I played with it a bit more: find_package
has two modes, a module one and a config one.
Now in my distro, 1.8.0 does not provide a config file while 1.8.1 does (— pretending to be version 1.9.0 on a side note).
I seem to have three options now:
- a)
find_package(GTest 1.8.1 CONFIG REQUIRED)
withCONFIG
to require the config way and hence get version checking working and exclude 1.8.0 effectively, without strong need it seems, according to your experience - b)
find_package(GTest REQUIRED)
without1.8.1
hence accepting any version of GTest, including potentially too old ones and hence failing duringmake
later - c)
find_package(GTest 1.8.1 REQUIRED)
— i.e. keeping as is — to still document and communicate what we actually are looking for but not being strict to the last bit and hence again risk a fail atmake
stage later
What do you think? I'm tending towards waterproof (a) right now.