build: bump minimum CMake version to 3.12
This commit is contained in:
@@ -31,6 +31,7 @@ Changes from ns-3.40 to ns-3-dev
|
||||
* In preparation to enable C++20, the following actions have been taken due to compiler issues:
|
||||
* Precompiled headers have been disabled in GCC versions >= 12.2.
|
||||
* The `restrict` warning has been disabled in GCC versions 12.1-12.3.1.
|
||||
* Raised minimum CMake version to 3.12.
|
||||
|
||||
### Changed behavior
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ##############################################################################
|
||||
# Required CMake version #
|
||||
# ##############################################################################
|
||||
cmake_minimum_required(VERSION 3.10..3.10)
|
||||
cmake_minimum_required(VERSION 3.12..3.12)
|
||||
|
||||
# ##############################################################################
|
||||
# Project name #
|
||||
|
||||
8
ns3
8
ns3
@@ -858,16 +858,18 @@ def parse_version(version_str):
|
||||
|
||||
def cmake_check_version():
|
||||
# Check CMake version
|
||||
minimum_cmake_version = "3.12.0"
|
||||
cmake3 = shutil.which("cmake3")
|
||||
cmake = cmake3 if cmake3 else shutil.which("cmake")
|
||||
if not cmake:
|
||||
print("Error: CMake not found; please install version 3.10 or greater, or modify", path_variable)
|
||||
print(
|
||||
f"Error: CMake not found; please install version {minimum_cmake_version} or greater, or modify {path_variable}")
|
||||
exit(1)
|
||||
cmake = cmake.replace(".EXE", "").replace(".exe", "") # Trim cmake executable extension
|
||||
cmake_output = subprocess.check_output([cmake, "--version"]).decode("utf-8")
|
||||
version = re.findall("version (.*)", cmake_output)[0]
|
||||
if parse_version(version) < parse_version("3.10.0"):
|
||||
print("Error: CMake found at %s but version %s is older than 3.10" % (cmake, version))
|
||||
if parse_version(version) < parse_version(minimum_cmake_version):
|
||||
print(f"Error: CMake found at {cmake} but version {version} is older than {minimum_cmake_version}")
|
||||
exit(1)
|
||||
return cmake, version
|
||||
|
||||
|
||||
Reference in New Issue
Block a user