File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ # Detects the OS and sets appropriate variables.
16+ # CMAKE_SYSTEM_NAME only give us a coarse-grained name,
17+ # but the name like centos is necessary in some scenes
18+ # to distinguish system for customization.
19+ #
20+ # for instance, protobuf libs path is <install_dir>/lib64
21+ # on CentOS, but <install_dir>/lib on other systems.
22+
1523IF (WIN32 )
1624 SET (HOST_SYSTEM "win32" )
1725ELSE (WIN32 )
@@ -30,6 +38,10 @@ ELSE(WIN32)
3038 SET (HOST_SYSTEM "debian" )
3139 ELSEIF (LINUX_ISSUE MATCHES "Ubuntu" )
3240 SET (HOST_SYSTEM "ubuntu" )
41+ ELSEIF (LINUX_ISSUE MATCHES "Red Hat" )
42+ SET (HOST_SYSTEM "redhat" )
43+ ELSEIF (LINUX_ISSUE MATCHES "Fedora" )
44+ SET (HOST_SYSTEM "fedora" )
3345 ENDIF ()
3446 ENDIF (EXISTS "/etc/issue" )
3547
@@ -40,6 +52,10 @@ ELSE(WIN32)
4052 ENDIF ()
4153 ENDIF (EXISTS "/etc/redhat-release" )
4254
55+ IF (NOT HOST_SYSTEM )
56+ SET (HOST_SYSTEM ${CMAKE_SYSTEM_NAME} )
57+ ENDIF ()
58+
4359 ENDIF (APPLE )
4460ENDIF (WIN32 )
4561
You can’t perform that action at this time.
0 commit comments