[PATCH] D83995: Provide some instructions to guide the user on how to get a more up-to-date CMake in CMake error message

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 18:34:50 PDT 2020


mehdi_amini updated this revision to Diff 278646.
mehdi_amini added a comment.

(remove duplicated newline)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83995/new/

https://reviews.llvm.org/D83995

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -3,9 +3,19 @@
 cmake_minimum_required(VERSION 3.4.3)
 
 if ("${CMAKE_VERSION}" VERSION_LESS "3.13.4")
-  message(FATAL_ERROR
-    "Your CMake version is ${CMAKE_VERSION}. The minimum version of CMake "
-    "required to build LLVM is now 3.13.4.")
+  set(ERROR_MSG " Your CMake version is ${CMAKE_VERSION}. The minimum version of CMake "
+    " required to build LLVM is now 3.13.4.\n \n"
+    " You can download CMake from: https://github.com/Kitware/CMake/releases")
+  if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
+     string(APPEND ERROR_MSG "\n"
+      " or can locally get cmake in the current build directory:\n"
+      " $ wget https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0-Linux-x86_64.tar.gz\n"
+      " $ echo \"4d9a9d3351161073a67e49366d701b6fa4b0343781982dc5eef08a02a750d403  cmake-3.18.0-Linux-x86_64.tar.gz\" | sha256sum -c\n"
+      " $ tar -xf cmake-3.18.0-Linux-x86_64.tar.gz && (cd cmake-3.18.0-Linux-x86_64 && ./bootstrap && make)\n"
+      " # Done, cmake is usable, nothing is installed on the system, everything is self-contained *inside* the build directory itself.\n"
+      " $ ./cmake-3.18.0-Linux-x86_64/bin/cmake ../llvm/ -D.... # build LLVM as usual.")
+  endif()
+  message(FATAL_ERROR ${ERROR_MSG})
 endif()
 
 if(POLICY CMP0068)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83995.278646.patch
Type: text/x-patch
Size: 1437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200717/9aef3f9d/attachment-0001.bin>


More information about the llvm-commits mailing list