summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-29 15:31:15 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-29 15:31:15 +0200
commit011277d2af3cfee674b50fa8a7362e91e8ad29e8 (patch)
tree8120730512f9843fa54e5e84ab3d6713d73ff4fd /cmake
parenta3767d2fd184a9d317a867e1bede5167d7865091 (diff)
Fix: Kernel detection under Yocto build env
Change-Id: I2b21a6c2b5c812736ab3e7a480cbaa3f547819fc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cmake.d/04-build_options.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/cmake.d/04-build_options.cmake b/cmake/cmake.d/04-build_options.cmake
index 45b4720..1aa046a 100644
--- a/cmake/cmake.d/04-build_options.cmake
+++ b/cmake/cmake.d/04-build_options.cmake
@@ -37,6 +37,8 @@ endif(gcc_minimal_version)
if (kernel_minimal_version)
if(DEFINED ENV{SDKTARGETSYSROOT})
file(STRINGS $ENV{SDKTARGETSYSROOT}/usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE")
+ elseif(DEFINED ENV{PKG_CONFIG_SYSROOT_DIR})
+ file(STRINGS $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE")
else()
file(STRINGS /usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE")
endif()