summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-18 20:22:06 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-08-21 22:23:55 +0200
commit4d67d060455919313491e904d32eb53b303dc21c (patch)
treed3560b20a516a5b9956e0382c5b2e7657872cca7 /cmake/cmake.d
parent3a90fb6f2c4518ebab484cde90919c19456dc04c (diff)
Better OS detection and inclusion per distribution
Change-Id: I6f479353df990eb2ff9030b7427d48bb72f0416f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d')
-rw-r--r--cmake/cmake.d/02-variables.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/cmake.d/02-variables.cmake b/cmake/cmake.d/02-variables.cmake
index dd86d2b..ec6510f 100644
--- a/cmake/cmake.d/02-variables.cmake
+++ b/cmake/cmake.d/02-variables.cmake
@@ -54,14 +54,15 @@ if(EXISTS "/etc/os-release")
execute_process(COMMAND grep -E "^ID(=|_LIKE=)" /etc/os-release
OUTPUT_VARIABLE TMP_OSRELEASE
)
+
if (NOT TMP_OSRELEASE STREQUAL "")
- string(REGEX REPLACE ".*=" "" OSRELEASE ${TMP_OSRELEASE})
+ string(REGEX REPLACE ".*=([0-9a-z._-]*)\n" "\\1" OSRELEASE ${TMP_OSRELEASE})
else()
- set(OSRELEASE "NOT DEBIAN OS")
+ set(OSRELEASE "NO COMPATIBLE !")
endif()
- message(STATUS "OSRELEASE = ${OSRELEASE}")
+ message(STATUS "Distribution used ${OSRELEASE}")
else()
- set(OSRELEASE "NOT DEBIAN OS")
+ set(OSRELEASE "NO COMPATIBLE !")
endif()
if(DEFINED ENV{SDKTARGETSYSROOT})