From febf9a0b070a7c5036f2b32f12167952f1597727 Mon Sep 17 00:00:00 2001 From: liaogang Date: Fri, 20 Jan 2017 00:11:08 +0800 Subject: [PATCH] Add comments and CMAKE_SYSTEM_NAME --- cmake/system.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/system.cmake b/cmake/system.cmake index 485cf0eea1c..3e472da7e0b 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -12,6 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Detects the OS and sets appropriate variables. +# CMAKE_SYSTEM_NAME only give us a coarse-grained name, +# but the name like centos is necessary in some scenes +# to distinguish system for customization. +# +# for instance, protobuf libs path is /lib64 +# on CentOS, but /lib on other systems. + IF(WIN32) SET(HOST_SYSTEM "win32") ELSE(WIN32) @@ -45,7 +53,7 @@ ELSE(WIN32) ENDIF(EXISTS "/etc/redhat-release") IF(NOT HOST_SYSTEM) - SET(HOST_SYSTEM "unknown") + SET(HOST_SYSTEM ${CMAKE_SYSTEM_NAME}) ENDIF() ENDIF(APPLE) -- GitLab