From b5565bd8c59cdd2ad6d806c403f63b274c8e78cf Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Mon, 10 Feb 2020 23:26:55 +0100 Subject: [PATCH] feature: added source and deb packages --- CMakeLists.txt | 20 ++++++++++++++++++++ cmake/webfuse_adapter.cmake | 9 +++++---- cmake/webfuse_core.cmake | 2 +- cmake/webfuse_provider.cmake | 9 +++++---- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f346e9d..3b77e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,3 +41,23 @@ include(webfuse_core) include(webfuse_adapter) include(webfuse_provider) include(unit_tests) + +set(CPACK_SOURCE_GENERATOR "TGZ") +set(CPACK_GENERATOR "DEB") +set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +set(CPACK_DESCRIPTION "Websocket filesystem based on libfuse") +#set(CPACK_COMPONENTS_ALL libraries) +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Falk Werner") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) + +set(CPACK_DEBIAN_LIBRARIES_FILE_NAME "webfuse_${PROJECT_VERSION}_${CMAKE_SYSTEM_NAME}.deb") +set(CPACK_DEBIAN_LIBRARIES_PACKAGE_NAME "webfuse") + +set(CPACK_DEBIAN_HEADERS_FILE_NAME "webfuse-dev_${PROJECT_VERSION}_${CMAKE_SYSTEM_NAME}.deb") +set(CPACK_DEBIAN_HEADERS_PACKAGE_NAME "webfuse-dev") +set(CPACK_DEBIAN_HEADERS_PACKAGE_DEPENDS "webfuse") + +include(CPack) \ No newline at end of file diff --git a/cmake/webfuse_adapter.cmake b/cmake/webfuse_adapter.cmake index 710c7a6..329a123 100644 --- a/cmake/webfuse_adapter.cmake +++ b/cmake/webfuse_adapter.cmake @@ -82,9 +82,10 @@ Libs: -L\${libdir} -lwebfuse-adapter -l${FUSE3_LIBRARIES} -l${LWS_LIBRARIES} -l$ Cflags: -I\${includedir}" ) -install(TARGETS webfuse-adapter DESTINATION lib${LIB_SUFFIX}) -install(FILES include/webfuse_adapter.h DESTINATION include) -install(DIRECTORY include/webfuse/adapter DESTINATION include/webfuse) -install(FILES "${PROJECT_BINARY_DIR}/libwebfuse-adapter.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig) +install(TARGETS webfuse-adapter DESTINATION lib${LIB_SUFFIX} COMPONENT libraries) +install(FILES "${PROJECT_BINARY_DIR}/libwebfuse-adapter.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT libraries) + +install(FILES include/webfuse_adapter.h DESTINATION include COMPONENT headers) +install(DIRECTORY include/webfuse/adapter DESTINATION include/webfuse COMPONENT headers) endif(NOT WITHOUT_ADAPTER) diff --git a/cmake/webfuse_core.cmake b/cmake/webfuse_core.cmake index 9af4b2b..b162f40 100644 --- a/cmake/webfuse_core.cmake +++ b/cmake/webfuse_core.cmake @@ -15,4 +15,4 @@ set_target_properties(webfuse-core PROPERTIES OUTPUT_NAME webfuse-core) target_include_directories(webfuse-core PUBLIC lib) set_target_properties(webfuse-core PROPERTIES C_VISIBILITY_PRESET hidden) -install(DIRECTORY include/webfuse/core DESTINATION include/webfuse) +install(DIRECTORY include/webfuse/core DESTINATION include/webfuse COMPONENT headers) diff --git a/cmake/webfuse_provider.cmake b/cmake/webfuse_provider.cmake index efbae88..b42f1f4 100644 --- a/cmake/webfuse_provider.cmake +++ b/cmake/webfuse_provider.cmake @@ -47,9 +47,10 @@ Libs: -L\${libdir} -lwebfuse-provider -l${LWS_LIBRARIES} -l${JANSSON_LIBRARIES} Cflags: -I\${includedir}" ) -install(TARGETS webfuse-provider DESTINATION lib${LIB_SUFFIX}) -install(FILES include/webfuse_provider.h DESTINATION include) -install(DIRECTORY include/webfuse/provider DESTINATION include/webfuse) -install(FILES "${PROJECT_BINARY_DIR}/libwebfuse-provider.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig) +install(TARGETS webfuse-provider DESTINATION lib${LIB_SUFFIX} COMPONENT libraries) +install(FILES "${PROJECT_BINARY_DIR}/libwebfuse-provider.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT libraries) + +install(FILES include/webfuse_provider.h DESTINATION include COMPONENT headers) +install(DIRECTORY include/webfuse/provider DESTINATION include/webfuse COMPONENT headers) endif(NOT WITHOUT_PROVIDER)