summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-24 17:59:53 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:20 +0200
commit74ce3be6d81a993ff3e02734e8324a5057a060c0 (patch)
treef5230b2f40d2d8b20d5bcf939a3fc0d83804d80d
parentb7b68ca206f351c85847801e303d7694d6130b4f (diff)
Added possibility to check linux kernel version
Change-Id: I212e1a5a2dc16c6cc2eb78523dbf9496d9da234a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/common.cmake10
-rw-r--r--cmake/config.cmake.sample6
2 files changed, 14 insertions, 2 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake
index 4c85498..1d43a73 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -52,7 +52,7 @@ macro(PROJECT_TARGET_ADD TARGET_NAME)
set(TARGET_NAME ${TARGET_NAME})
endmacro(PROJECT_TARGET_ADD)
-# Check GCC minimal version version
+# Check GCC minimal version
if (gcc_minimal_version)
message (STATUS "${Blue}-- Check gcc_minimal_version (found gcc version ${CMAKE_C_COMPILER_VERSION}) (found g++ version ${CMAKE_CXX_COMPILER_VERSION})${ColourReset}")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version})
@@ -60,6 +60,14 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_CO
endif()
endif(gcc_minimal_version)
+# Check Kernel minimal version
+if (kernel_minimal_version)
+ message (STATUS "${Blue}-- Check kernel_minimal_version (found kernel version ${CMAKE_SYSTEM_VERSION})${ColourReset}")
+ if (CMAKE_SYSTEM_VERSION VERSION_LESS ${kernel_minimal_version})
+ message(FATAL_ERROR "${Red}**** FATAL: Require at least ${kernel_minimal_version} please use a recent kernel.")
+endif()
+endif(kernel_minimal_version)
+
macro(defstr name value)
add_definitions(-D${name}=${value})
endmacro(defstr)
diff --git a/cmake/config.cmake.sample b/cmake/config.cmake.sample
index 66be37c..27d9f17 100644
--- a/cmake/config.cmake.sample
+++ b/cmake/config.cmake.sample
@@ -44,9 +44,13 @@ set(PROJECT_APP_TEMPLATES_DIR "conf.d")
# ----------------------------------
set(CMAKE_BUILD_TYPE "DEBUG")
+# Kernel selection if needed. Impose a minimal version.
+# -----------------------------------------------
+set (kernel_minimal_version 4.8)
+
# Compiler selection if needed. Impose a minimal version.
# -----------------------------------------------
-set (gcc_minimal_version 4.9)
+set (gcc_minimal_version 4.9)
# PKG_CONFIG required packages
# -----------------------------