代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。