From 6c0b05955db1217fd19f5745375c1553826e38cb Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 12 Nov 2014 15:36:20 +0100 Subject: [PATCH] added target "dist" to CMakeLists.txt, which uses "git archive" to build source tarball --- CMakeLists.txt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ed3f29..744c8d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,13 @@ set(CPACK_SOURCE_IGNORE_FILES ) set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TARGET}-${VERSION}") +# "make dist" target +set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION}) +add_custom_target(dist + COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD + | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + # cmake: build the application in the source directory add_subdirectory(src) -- 1.7.1