cmake: Add untested 'dist' target using git archive
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f34a405..d722138 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,13 @@
 SET(LIBZIP_VERSION_MICRO ${PACKAGE_VERSION_MICRO})
 SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 
+SET(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
+ADD_CUSTOM_TARGET(dist
+  COMMAND git config tar.tar.xz.command "xz -c"
+  COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.gz
+  COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.xz
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  )
 IF(NOT BUILD_SHARED_LIBS)
   SET(ZIP_STATIC TRUE)
 ENDIF()
diff --git a/TODO.md b/TODO.md
index 1f48466..7b5e3a9 100644
--- a/TODO.md
+++ b/TODO.md
@@ -7,12 +7,10 @@
 
 * migration to CMake
   - tests (libgit2 tests using ctest)
-  - how to make source distributions
+  - test dist target
   - replace `make distcheck`
-  - cmake on Linux: man pages not built (https://github.com/nih-at/libzip/issues/8)
   - check generated xcode project
   - add custom targets:
-    - mkman (mdoc -> man)
     - handle_links (one man page for multiple functions)
     - update-errors (zip.h -> zip_errors.mdoc)
     - regress zip.zip -> zip