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>2017-05-24 17:59:53 +0200
commit2de0f6ce0d934bad9a80908bbc4a93a837f20eeb (patch)
treee1a0b95e6ee8846f326273646bd026eb88329097
parent0d28ff2c0f86d7c681a47638b0991f87e337c01b (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
# -----------------------------