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") MESSAGE(FATAL_ERROR "$sudo yum -y install libcurl-devel czmq-devel openssl-devel uuid-devel") ELSEIF (${OS_DISTRIB_NAME} MATCHES "Ubuntu") MESSAGE(FATAL_ERROR "$sudo -S apt -y install libcurl4-openssl-dev libczmq-dev libssl-dev uuid-dev") ENDIF () ELSE () MESSAGE(FATAL_ERROR "Run command to install system dependencies libraries [libcurl,libssl,libcrypto,libzmq, uuid] by yourself") ENDIF () ENDFUNCTION(LINUX_INSTALL_SYSTEM_PACKAGE)