1 Star 0 Fork 1

漆夜/librpm-wrapper-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
漆夜 提交于 2018-01-23 15:55 . 功能拆分以及接口包装
cmake_minimum_required(VERSION 2.8)
project(software)
set(LIB_VERSION 1.0.0)
include(modules/IdentifyOS.cmake)
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall -g -ggdb -fPIC")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -fPIC")
set(CMAKE_CXX_STANDARD 11)
set(LIB_VERSION 1.0.0)
set(CMAKE_C_FLAGS "-static-libgcc")
set(CMAKE_SKIP_RPATH FALSE)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "." "/usr/local/sniper/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_definitions(-D__STDC_FORMAT_MACROS)
add_subdirectory(example)
MESSAGE(STATUS "operation system name is ${CMAKE_OS_NAME}")
IF (CMAKE_OS_NAME MATCHES "Ubuntu")
MESSAGE(STATUS "current platform: Ubuntu ")
add_definitions(-DUbuntu)
ELSEIF (CMAKE_OS_NAME MATCHES "Debian")
MESSAGE(STATUS "current platform: Debian")
add_definitions(-DDebian)
ELSEIF (CMAKE_OS_NAME MATCHES "RedHat")
MESSAGE(STATUS "current platform: RedHat")
add_subdirectory(librpmcpp)
add_definitions(-DRedHat)
ELSE ()
MESSAGE(STATUS "unknown system!!!")
ENDIF (CMAKE_OS_NAME MATCHES "Ubuntu")
set(CMAKE_INSTALL_PREFIX example)
include_directories(/usr/local/include)
include_directories(/usr/include)
include_directories(.)
aux_source_directory(. SRC_LIST)
link_directories(/usr/local/lib)
link_directories(/usr/lib)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib)
add_library(${PROJECT_NAME} SHARED ${SRC_LIST})
SET(LIBRARY_OUTPUT_PATH lib)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${LIB_VERSION})
IF (CMAKE_OS_NAME MATCHES "RedHat")
target_link_libraries(${PROJECT_NAME} rpmcpp)
ENDIF (CMAKE_OS_NAME MATCHES "RedHat")
target_link_libraries(${PROJECT_NAME} boost_regex)
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/www.evangerlion.com/librpm-wrapper-cpp.git
git@gitee.com:www.evangerlion.com/librpm-wrapper-cpp.git
www.evangerlion.com
librpm-wrapper-cpp
librpm-wrapper-cpp
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385