-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enable SLES build * enable SLES build update * enable SLES build update
- Loading branch information
1 parent
74eb710
commit 7983da3
Showing
5 changed files
with
63 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# ######################################################################## | ||
# Copyright 2019 Advanced Micro Devices, Inc. | ||
# ######################################################################## | ||
|
||
function (get_os_id OS_ID) | ||
set(_os_id "unknown") | ||
|
||
if (EXISTS "/etc/os-release") | ||
read_key("ID" _os_id) | ||
endif() | ||
|
||
if (_os_id STREQUAL "opensuse-leap") | ||
set(_os_id "sles") | ||
endif() | ||
|
||
set(${OS_ID} ${_os_id} PARENT_SCOPE) | ||
set(${OS_ID}_${_os_id} TRUE PARENT_SCOPE) | ||
endfunction() | ||
|
||
|
||
function (read_key KEYVALUE OUTPUT) | ||
#finds the line with the keyvalue | ||
file (STRINGS /etc/os-release _keyvalue_line REGEX "^${KEYVALUE}=") | ||
|
||
#remove keyvalue= | ||
string (REGEX REPLACE "^${KEYVALUE}=\"?(.*)" "\\1" _output "${_keyvalue_line}") | ||
|
||
#remove trailing quote | ||
string (REGEX REPLACE "\"$" "" _output "${_output}") | ||
set(${OUTPUT} ${_output} PARENT_SCOPE) | ||
endfunction () |