summaryrefslogtreecommitdiffstats
path: root/cmake/common.cmake
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 /cmake/common.cmake
parentb7b68ca206f351c85847801e303d7694d6130b4f (diff)
Added possibility to check linux kernel version
Change-Id: I212e1a5a2dc16c6cc2eb78523dbf9496d9da234a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/common.cmake')
-rw-r--r--cmake/common.cmake10
1 files changed, 9 insertions, 1 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)