From d60922f755ae0ecd5a85626321cad69d93d1f04f Mon Sep 17 00:00:00 2001 From: Eugeny Kalishenko Date: Sun, 5 Apr 2015 02:03:40 +0300 Subject: [PATCH] Building only library with cmake --- CMakeLists.txt | 43 ++++++++++++++++++++++++++++++++ install/description.txt | 1 + install/post_install_script.sh | 1 + install/post_uninstall_script.sh | 1 + src/CMakeLists.txt | 15 +++++++++++ 5 files changed, 61 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 install/description.txt create mode 100755 install/post_install_script.sh create mode 100755 install/post_uninstall_script.sh create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..aad0857e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 2.8.10) +cmake_policy(SET CMP0016 NEW) + +project(cds) + +set(PROJECT_VERSION 2.1.0) + +find_package(Boost COMPONENTS system thread REQUIRED) +include_directories(${Boost_INCLUDE_DIRS}) + +set(CDS_SHARED_LIBRARY ${PROJECT_NAME}) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif() + +include_directories(${CMAKE_SOURCE_DIR}) + +enable_testing() + +add_subdirectory(${CMAKE_SOURCE_DIR}/src) + +### FOR PACKAGING ##################################################################################### +set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) +set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +set(CPACK_PACKAGE_RELEASE 1) + +set(CPACK_RPM_PACKAGE_SUMMARY "Library of concurrent data structures") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/install/description.txt") +set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/install/post_install_script.sh") +set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/install/post_uninstall_script.sh") +#set(CPACK_RPM_CHANGELOG_FILE ${CHANGELOG_INCLUDE}) +set(CPACK_RPM_PACKAGE_LICENSE GPL) +set(CPACK_RPM_PACKAGE_GROUP "System Environment/Base") +set(CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.50") + +set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CPACK_PACKAGING_INSTALL_PREFIX}) +set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/local) +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}") +set(DEPLOY_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}") + +include(CPack) diff --git a/install/description.txt b/install/description.txt new file mode 100644 index 00000000..14beb953 --- /dev/null +++ b/install/description.txt @@ -0,0 +1 @@ +ПК обработки измерительной информации НАП \ No newline at end of file diff --git a/install/post_install_script.sh b/install/post_install_script.sh new file mode 100755 index 00000000..0331ecaf --- /dev/null +++ b/install/post_install_script.sh @@ -0,0 +1 @@ +/usr/sbin/ldconfig \ No newline at end of file diff --git a/install/post_uninstall_script.sh b/install/post_uninstall_script.sh new file mode 100755 index 00000000..0331ecaf --- /dev/null +++ b/install/post_uninstall_script.sh @@ -0,0 +1 @@ +/usr/sbin/ldconfig \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..418b8c89 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,15 @@ +set(SOURCES hp_gc.cpp + init.cpp + dhp_gc.cpp + urcu_gp.cpp + urcu_sh.cpp + michael_heap.cpp + topology_hpux.cpp + topology_linux.cpp + topology_osx.cpp + dllmain.cpp) + +add_library(${CDS_SHARED_LIBRARY} SHARED ${SOURCES}) +target_link_libraries(${CDS_SHARED_LIBRARY} PRIVATE ${Boost_LIBRARIES}) + +install(TARGETS ${CDS_SHARED_LIBRARY} DESTINATION lib) \ No newline at end of file -- 2.34.1