-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move logic into separate file. refs #7021
- Loading branch information
1 parent
b4e3fb9
commit ef55d93
Showing
2 changed files
with
23 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
find_program (LSB_CMD lsb_release) | ||
if ( LSB_CMD ) | ||
# get the distribution | ||
execute_process ( COMMAND ${LSB_CMD} -i | ||
OUTPUT_VARIABLE UNIX_DIST | ||
OUTPUT_STRIP_TRAILING_WHITESPACE ) | ||
string ( REGEX REPLACE "Distributor ID:" "" UNIX_DIST ${UNIX_DIST} ) | ||
string ( STRIP ${UNIX_DIST} UNIX_DIST ) | ||
string ( REGEX REPLACE "RedHatEnterpriseClient" "RedHatEnterprise" UNIX_DIST ${UNIX_DIST} ) | ||
string ( REGEX REPLACE "RedHatEnterpriseWorkstation" "RedHatEnterprise" UNIX_DIST ${UNIX_DIST} ) | ||
# get the codename | ||
execute_process ( COMMAND ${LSB_CMD} -c | ||
OUTPUT_VARIABLE UNIX_CODENAME | ||
OUTPUT_STRIP_TRAILING_WHITESPACE ) | ||
string ( REGEX REPLACE "Codename:" "" UNIX_CODENAME ${UNIX_CODENAME} ) | ||
string ( STRIP ${UNIX_CODENAME} UNIX_CODENAME ) | ||
else ( LSB_CMD ) | ||
set ( UNIX_DIST "" ) | ||
set ( UNIX_CODENAME "" ) | ||
endif ( LSB_CMD ) | ||
message ( STATUS " DIST: ${UNIX_DIST} CODENAME: ${UNIX_CODENAME}" ) |