2023-01-17 08:22:53 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
|
|
|
|
|
|
|
|
FUNCTION(LINUX_INSTALL_SYSTEM_PACKAGE)
|
|
|
|
SET(OS_RELEASE_FILE "/etc/os-release")
|
|
|
|
SET(OS_DISTRIB_NAME "")
|
|
|
|
|
|
|
|
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND EXISTS ${OS_RELEASE_FILE})
|
|
|
|
FILE(STRINGS ${OS_RELEASE_FILE} OS_RELEASE_NAME LIMIT_COUNT 1)
|
|
|
|
STRING(FIND ${OS_RELEASE_NAME} "CentOS" SUB_OUT)
|
|
|
|
IF (${SUB_OUT} MATCHES "6")
|
|
|
|
SET(OS_DISTRIB_NAME "CentOS")
|
|
|
|
ELSE ()
|
|
|
|
STRING(FIND ${OS_RELEASE_NAME} "Ubuntu" SUB_OUT)
|
|
|
|
|
|
|
|
IF (${SUB_OUT} MATCHES "6")
|
|
|
|
SET(OS_DISTRIB_NAME "Ubuntu")
|
|
|
|
ENDIF ()
|
|
|
|
ENDIF ()
|
|
|
|
|
|
|
|
MESSAGE("Run this command to install system(${OS_DISTRIB_NAME}) dependencies libraries:")
|
|
|
|
IF (${OS_DISTRIB_NAME} MATCHES "CentOS")
|
2023-04-20 08:46:20 +00:00
|
|
|
MESSAGE(FATAL_ERROR "$sudo yum -y install libcurl-devel czmq-devel openssl-devel libjson-c-devel")
|
2023-01-17 08:22:53 +00:00
|
|
|
ELSEIF (${OS_DISTRIB_NAME} MATCHES "Ubuntu")
|
2023-04-20 08:46:20 +00:00
|
|
|
MESSAGE(FATAL_ERROR "$sudo apt -y install libcurl4-openssl-dev libczmq-dev libssl-dev libjson-c-dev")
|
2023-01-17 08:22:53 +00:00
|
|
|
ENDIF ()
|
2023-01-30 02:15:53 +00:00
|
|
|
ELSE ()
|
2023-01-30 06:12:33 +00:00
|
|
|
MESSAGE(FATAL_ERROR "Run command to install system dependencies libraries [libcurl,libssl,libcrypto,libzmq] by yourself")
|
2023-01-17 08:22:53 +00:00
|
|
|
ENDIF ()
|
|
|
|
ENDFUNCTION(LINUX_INSTALL_SYSTEM_PACKAGE)
|