CMakeLists.txt uses incorrect GTest variables
wouterbeek opened this issue · comments
The documentation of the CMake package finer for GTest states that -- amongs others -- the following variables are defined:
GTEST_INCLUDE_DIRS
GTEST_LIBRARIES
The CMakeLists.txt
file of this project uses the singular version of these variables, but these are not made available by CMake:
GTEST_INCLUDE_DIR
GTEST_LIBRARY
Because of this, this project cannot be compiled when URIPARSER_BUILD_TESTS
is set to ON
(the default value):
CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
What I understood is:
GTEST_INCLUDE_DIRS
is the official variable to do gtest include dir(s)- You have gtest >=1.8.0 installed (in a standard location or are providing
CMAKE_INSTALL_PREFIX
to help CMake) but you're not able to build because CMake breaks while trying to find GTest.
What I don't get so far:
- Why is
GTEST_INCLUDE_DIR
without trailingS
a problem? Both CMake 3.3.0 and 3.15.0 contain linesset(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
so the singular should be available as well - uriparser makes use of
GTEST_BOTH_LIBRARIES
notGTEST_LIBRARY
—GTEST_BOTH_LIBRARIES
is available in both CMake 3.3.0 and 3.15.0, as well.
Any ideas?
PS: Let's see how the CI likes #81.
@hartwork You're right, this may be an issue in the Conan package for GTest which I was using to install the dependencies.
I've opened an issue there: bincrafters/community#929
Great, thank you!
With #81 merged I'll close this issue as fixed. Happy to re-open as needed.