Add minimum requirements for CMake, gcc and clang

On Linux, link with stdc++exp
Define requirements in README
This commit is contained in:
Magne authored and Magne Sjaastad committed 2025-05-09 15:54:28 +02:00
1 parent 53517fad83
commit 57017a166c
4 files changed
+38 -4

No files matched your search

+26
View File
@@ -1,11 +1,37 @@
# The way boost is configured and used in Boost 1.86 requires CMake 3.26
cmake_minimum_required(VERSION 3.26)
# Check if CMake version is 4.0 or higher
if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.0)
message(
FATAL_ERROR
"CMake version ${CMAKE_VERSION} detected. We are investigating issues for CMake 4. Use CMake 3.x to build ResInsight."
)
endif()
include(CheckCSourceCompiles)
include(FetchContent)
project(ResInsight)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
message(
FATAL_ERROR
"Minimum GCC version is 13, detected version: ${CMAKE_CXX_COMPILER_VERSION}"
)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
message(
FATAL_ERROR
"Minimum supported version is Clang 19, detected version: ${CMAKE_CXX_COMPILER_VERSION}"
)
endif()
endif()
# Ensure all binary files ensd up in the same folder as the executable
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})