summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/version.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/version.cmake b/cmake/version.cmake
index 1cae665..07483af 100644
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -6,7 +6,10 @@
# macro to get Linux kernel version from KERNEL_BUILD_DIR
macro(get_kernel_version LINUX_KERNEL_VERSION KERNEL_BUILD_DIR)
- string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR})
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR})
+ if(LINUX_KERNEL_VERSION STREQUAL "")
+ set(LINUX_KERNEL_VERSION "unknown")
+ endif()
endmacro(get_kernel_version)
# macro to get short hash of latest commit