https://github.com/google/googletest/commit/23b2a3b1cf803999fb38175f6e9e038a4495c8a5 uses VERSION_GREATER_EQUAL which is not available in old versions of cmake.
See more at https://github.com/glfw/glfw/issues/1584
This is affecting me as well:
CMake Error at /tmp/tmp.ZFDsBwhT4P/googletest-src/CMakeLists.txt:13 (if):
if given arguments:
"CMAKE_VERSION" "VERSION_GREATER_EQUAL" "3.1"
Unknown arguments specified
Running in a Docker container on Ubuntu 16.04 with cmake 3.5.1
Same issue here
I'm hitting this too.
If this line: https://github.com/google/googletest/blob/master/CMakeLists.txt#L13
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.1")
is changed to
if (CMAKE_VERSION VERSION_GREATER "3.0.2")
then the behaviour should be equivalent, since CMake version 3.0.2 directly precedes version 3.1, but it will work with older versions such as CMake 3.5 (which is probably what Ubuntu 16.04 users are using).
Same issue here.
When will this be merged to master?
FYI: internal cl/300766233
To reproduce using a docker env and CMake 3.5.2...
Dockerfile:
# Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/debian
FROM debian:latest
LABEL maintainer="[email protected]"
CMD ["/bin/bash"]
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN apt-get update -qq \
&& apt-get install -yq git wget libssl-dev build-essential libidn11 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install CMake 3.5.2
RUN wget "https://cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.sh" \
&& chmod a+x cmake-3.5.2-Linux-x86_64.sh \
&& ./cmake-3.5.2-Linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.5.2-Linux-x86_64.sh
RUN cmake --version
# Download googletest
RUN git clone https://github.com/google/googletest.git
WORKDIR googletest
# comment the following line to reproduce the error
RUN sed -i "s/VERSION_GREATER_EQUAL \"3\.1\"/VERSION_GREATER \"3\.0\.2\"/g" CMakeLists.txt
#RUN cat CMakeLists.txt
RUN cmake -H. -Bbuild
Test using:
docker build -t gtest -f Dockerfile .
Most helpful comment
I'm hitting this too.
If this line: https://github.com/google/googletest/blob/master/CMakeLists.txt#L13
is changed to
then the behaviour should be equivalent, since CMake version 3.0.2 directly precedes version 3.1, but it will work with older versions such as CMake 3.5 (which is probably what Ubuntu 16.04 users are using).