Skip to content

Commit

Permalink
Replace the "tarball" CMake target with CPack
Browse files Browse the repository at this point in the history
Related to #135
  • Loading branch information
mheily committed Apr 29, 2022
1 parent d0b5ca3 commit a799ad6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config.h
*.ddeb
*.swp
.fuse*
cmake-build-*/
CMakeCache.txt
CMakeFiles/
CPackConfig.cmake
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,19 @@ else()
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "${CPACK_PACKAGE_NAME} (= ${PROJECT_VERSION})")
endif()

set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES
"cmake-build-*"
".github/"
".git/"
".*.swp"
)
set(CPACK_SOURCE_GENERATOR "TXZ")

set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Heily <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/mheily/libkqueue")
include(CPack)

add_custom_target(tarball git archive -o "libkqueue-${PROJECT_VERSION}.tar.gz" --prefix "libkqueue-${PROJECT_VERSION}/" HEAD)

#
# Ensure variables which represent arguments are not
# cached. This provides more of a sane interface where
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ Xcode (project)

cmake -G "Xcode" <path to source>

Source archive
--------------

mkdir -p cmake-build-source
cd cmake-build-source
cmake ..
make package_source

Running Unit Tests
------------------

Expand Down

0 comments on commit a799ad6

Please sign in to comment.