From 965ac3cedd30a3b4c9c824661fa649b9f86dde11 Mon Sep 17 00:00:00 2001
From: Christoph Junghans <junghans@lanl.gov>
Date: Fri, 8 Jun 2018 16:18:02 -0600
Subject: [PATCH] cmake: lower cmake requirement to 2.8.12

---
 cmake/CMakeLists.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index e6eacb89cb..9c3836becc 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -2,9 +2,9 @@
 # CMake build system
 # This file is part of LAMMPS
 # Created by Christoph Junghans and Richard Berger
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 2.8.12)
 
-project(lammps LANGUAGES CXX)
+project(lammps CXX)
 set(SOVERSION 0)
 set(LAMMPS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src)
 set(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
@@ -155,6 +155,9 @@ if(PKG_MEAM OR PKG_USER-H5MD OR PKG_USER-QMMM)
 endif()
 
 if(PKG_MSCG)
+  if (CMAKE_VERSION VERSION_LESS "3.1") 
+    message(FATAL_ERROR "For the MSCG package you need at least cmake-3.1")
+  endif()
   # starting with CMake 3.1 this is all you have to do to enforce C++11
   set(CMAKE_CXX_STANDARD 11) # C++11...
   set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
@@ -658,6 +661,9 @@ if(PKG_USER-INTEL)
 endif()
 
 if(PKG_GPU)
+    if (CMAKE_VERSION VERSION_LESS "3.1") 
+      message(FATAL_ERROR "For the GPU package you need at least cmake-3.1")
+    endif()
     set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
     set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
                     ${GPU_SOURCES_DIR}/fix_gpu.h
-- 
GitLab