Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1155 from gangliao/centos
Browse files Browse the repository at this point in the history
Detect CentOS 7 in CMake
  • Loading branch information
QiJune authored Jan 16, 2017
2 parents 1efa03e + 66851af commit b000386
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmake/system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ELSE(WIN32)
SET(MACOS_VERSION ${VERSION})
SET(HOST_SYSTEM "macosx")
ELSE(APPLE)

IF(EXISTS "/etc/issue")
FILE(READ "/etc/issue" LINUX_ISSUE)
IF(LINUX_ISSUE MATCHES "CentOS")
Expand All @@ -31,6 +32,14 @@ ELSE(WIN32)
SET(HOST_SYSTEM "ubuntu")
ENDIF()
ENDIF(EXISTS "/etc/issue")

IF(EXISTS "/etc/redhat-release")
FILE(READ "/etc/redhat-release" LINUX_ISSUE)
IF(LINUX_ISSUE MATCHES "CentOS")
SET(HOST_SYSTEM "centos")
ENDIF()
ENDIF(EXISTS "/etc/redhat-release")

ENDIF(APPLE)
ENDIF(WIN32)

Expand Down

0 comments on commit b000386

Please sign in to comment.