Skip to content

Commit 25f761e

Browse files
authored
Merge pull request #83 from taotieren/update-cmake
Use the kernel version as a fallback
2 parents 14f0be7 + 51e2ebd commit 25f761e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Changes for 3.1.1:
2+
3+
* Fixed issue #82: Use the kernel version as a fallback
4+
15
Changes for 3.1.0:
26

37
* New feature: Support for generating C code.

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ elseif (UNIX)
8282
# Get Linux distribution info.
8383
GetOsReleaseInfo(LINUX_DIST_NAME LINUX_DIST_VER )
8484

85+
if("${LINUX_DIST_VER}" STREQUAL "")
86+
# Use the kernel version as a fallback
87+
execute_process(COMMAND uname -r
88+
OUTPUT_VARIABLE LINUX_DIST_VER
89+
OUTPUT_STRIP_TRAILING_WHITESPACE)
90+
endif()
91+
8592
# Extract distribution MAJOR version
86-
get_major_version(${LINUX_DIST_VER} LINUX_DIST_VER_MAJOR)
93+
get_major_version("${LINUX_DIST_VER}" LINUX_DIST_VER_MAJOR)
8794

8895
MESSAGE( STATUS "LINUX_DIST_NAME: " ${LINUX_DIST_NAME} )
8996
MESSAGE( STATUS "LINUX_DIST_VER: " ${LINUX_DIST_VER} )

0 commit comments

Comments
 (0)