Add 'make dist' target
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 26 Sep 2011 09:05:30 +0000 (11:05 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 26 Sep 2011 09:08:29 +0000 (11:08 +0200)
CMakeLists.txt

index 30f8a9f..37243a9 100644 (file)
@@ -101,6 +101,12 @@ add_subdirectory(examples)
 add_subdirectory(packages)
 add_subdirectory(test)
 
+# "make dist" target
+set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION_STRING})
+add_custom_target(dist
+    COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
+            | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
 
 # Documentation