From 18b4f4ef37c1e291446dc2204443d61be3c0518a Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 12 Oct 2020 10:37:07 +0200 Subject: [PATCH] Install CMake 3 instead of CMake 2 in Centos 7 Docker image Some constructs used in the CMake builds are not supported in CMake 2, e.g. the $ generator expression. See also: * https://centos.pkgs.org/7/epel-x86_64/cmake3-3.17.3-3.el7.x86_64.rpm.html#howto * https://stackoverflow.com/questions/48831131/cmake-on-linux-centos-7-how-to-force-the-system-to-use-cmake3 --- ci/centos7/Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ci/centos7/Dockerfile b/ci/centos7/Dockerfile index 2b193c78c..6ae828c6c 100644 --- a/ci/centos7/Dockerfile +++ b/ci/centos7/Dockerfile @@ -3,12 +3,17 @@ FROM centos:7 # Development tools RUN yum -y groupinstall 'Development Tools' +RUN yum install -y \ +# Install epel-release rpm (Needed for cmake3. Must be a separate step) +https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm \ +&& yum clean all && rm -rf /var/cache/yum + # Centos build utilities RUN yum -y install \ libtool-ltdl-devel \ libedit-devel \ ksh \ -cmake \ +cmake3 \ # Option glut freeglut-devel \ # Option gts @@ -70,5 +75,10 @@ tk-devel \ python-pytest \ && rpm --install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python36-py-1.4.32-2.el7.noarch.rpm \ && rpm --install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python36-pytest-2.9.2-4.el7.noarch.rpm \ +&& alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ +--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ +--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ +--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ +--family cmake \ # Clean up && yum clean all && rm -rf /var/cache/yum -- 2.40.0