Detect Yocto as OS distribution 41/14741/1
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 27 Jun 2018 16:20:25 +0000 (18:20 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 27 Jun 2018 16:20:25 +0000 (18:20 +0200)
When you are in a Yocto Environment there isn't os-release
file, so if the Yocto env is detected then position
manually the OSRELEASE variable to yocto-build.

Change-Id: I10029664100bb73aa74eaa85c1a4295c4ab65428
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
cmake/common.cmake

index e826bee..02ef1a4 100644 (file)
@@ -52,7 +52,8 @@ if(EXISTS ${OS_RELEASE_PATH})
        else()
                set(OSRELEASE "NOT COMPATIBLE !")
        endif()
-
+elseif(${BUILD_ENV_SYSROOT} == $ENV{PKG_CONFIG_SYSROOT_DIR})
+       set(OSRELEASE "yocto-build")
 else()
        set(OSRELEASE "NOT COMPATIBLE ! Missing ${OS_RELEASE_PATH} file.")
 endif()