1 Star 0 Fork 168

Hanshize / iSulad

forked from openEuler / iSulad 
加入 Gitee
与超过 600 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 3.85 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
lifeng_isula 提交于 2020-03-27 19:33 . version: fix version git info
cmake_minimum_required (VERSION 2.8)
project (isulad)
include(cmake/helper.cmake)
include(cmake/options.cmake)
include(cmake/set_build_flags.cmake)
#set(CMAKE_C_COMPILER "gcc" CACHE PATH "c compiler")
set(GIT_COMMIT_HASH "8ff7dac0993cd75494a281b509c683280417ba5c")
message("-- commit id: " ${GIT_COMMIT_HASH})
add_definitions(-DISULAD_GIT_COMMIT="${GIT_COMMIT_HASH}")
execute_process(
COMMAND sh -c "date --rfc-3339 ns | sed -e 's/ /T/'"
OUTPUT_VARIABLE BUILD_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("-- build time: " ${BUILD_DATE})
add_definitions(-DISULAD_BUILD_TIME="${BUILD_DATE}")
if (NOT ISULAD_ROOT_PATH)
add_definitions(-DISULAD_ROOT_PATH="/var/lib/isulad")
endif()
if (NOT ISULAD_STATE_PATH)
add_definitions(-DISULAD_STATE_PATH="/var/run/isulad")
endif()
if (LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR_DEFAULT ${LIB_INSTALL_DIR})
else()
set(LIB_INSTALL_DIR_DEFAULT "lib")
endif()
# check depends library and headers
include(cmake/checker.cmake)
if (CHECKER_RESULT)
message(FATAL_ERROR "ERROR: Check library and headers failed")
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
"${CMAKE_BINARY_DIR}/conf/config.h"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/isulad.pc.in"
"${CMAKE_BINARY_DIR}/conf/isulad.pc"
)
# parse .proto files
include(cmake/protoc.cmake)
# llt and coverage
SET(CMAKE_VERBOSE_MAKEFILE OFF)
IF(ENABLE_COVERAGE)
MESSAGE(STATUS "Enable coverage compile option")
SET(COVERAGE_C_OPTION "${COVERAGE_OPTION} -fprofile-arcs -ftest-coverage -fkeep-inline-functions -fkeep-static-functions")
SET(COVERAGE_CXX_OPTION "${COVERAGE_OPTION} -fprofile-arcs -ftest-coverage")
ENDIF(ENABLE_COVERAGE)
IF(ENABLE_ASAN)
MESSAGE(STATUS "Enable asan compile option")
SET(ASAN_OPTIONS "${ASAN_OPTION} -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer")
ENDIF(ENABLE_ASAN)
IF(CMAKE_BUILD_TYPE STREQUAL Debug)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COVERAGE_C_OPTION} ${ASAN_OPTIONS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_CXX_OPTION} ${ASAN_OPTIONS}")
ENDIF()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
OPTION(ENABLE_LLT "llt switch" OFF)
IF(ENABLE_LLT)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
ENDIF(ENABLE_LLT)
# install all files
install(FILES ${CMAKE_BINARY_DIR}/conf/isulad.pc
DESTINATION ${LIB_INSTALL_DIR_DEFAULT}/pkgconfig PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/libisula.h
DESTINATION include/isulad)
install(FILES src/connect/client/isula_connect.h
DESTINATION include/isulad)
install(FILES src/container_def.h
DESTINATION include/isulad)
install(FILES src/types_def.h
DESTINATION include/isulad)
install(FILES src/error.h
DESTINATION include/isulad)
install(FILES src/engines/engine.h
DESTINATION include/isulad)
# install config files
set(conf_prefix "/etc")
if (CMAKE_INSTALL_SYSCONFDIR)
set(conf_prefix ${CMAKE_INSTALL_SYSCONFDIR})
endif()
install(FILES src/contrib/config/daemon.json
DESTINATION ${conf_prefix}/isulad PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/contrib/config/config.json src/contrib/config/systemcontainer_config.json
DESTINATION ${conf_prefix}/default/isulad PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/contrib/config/seccomp_default.json
DESTINATION ${conf_prefix}/isulad PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/contrib/config/hooks/default.json
DESTINATION ${conf_prefix}/default/isulad/hooks PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/contrib/sysmonitor/isulad-check.sh
DESTINATION ${conf_prefix}/default/isulad PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
install(FILES src/contrib/sysmonitor/isulad-monit
DESTINATION ${conf_prefix}/sysmonitor/process PERMISSIONS OWNER_READ OWNER_WRITE)

评论 ( 0 )

你可以在登录后,发表评论

C
1
https://gitee.com/Hanshize/iSulad.git
git@gitee.com:Hanshize/iSulad.git
Hanshize
iSulad
iSulad
master

搜索帮助

161121 f78d6d6f 1850385 154831 86f8c370 1850385