How to install cmake3.13?


#1

Here is what I have done:

container:
  image: gcc:latest
dependencies:
  cache_directories:
    - ~/cmake-3.13.3-Linux-x86_64
  override:
    - >
      if [ ! -d ~/cmake-3.13.3-Linux-x86_64 ]; then
        echo "No cache - building CMake"
        cd ~ && wget --quiet https://cmake.org/files/v3.13/cmake-3.13.3-Linux-x86_64.tar.gz && tar -xvf cmake-3.13.3-Linux-x86_64.tar.gz
      else
        echo "Cached CMake found"
      fi

task:
  tests_script: cmake -H. -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1;make;make test

  environment:
    PATH: "/home/ubuntu/cmake-3.13.3-Linux-x86_64/bin:$PATH"

But it seems remote system ignore cmake-install lines:

cmake -H. -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1;make;make test
/tmp/scripts1e00167939cb6694d2c422acd208a007.sh: line 4: cmake: command not found
Exit status: 127

How to install latest cmake correctly?(cmake-3.12 is also ok)