diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,33 @@ ) ENDIF() +CONFIGURE_FILE( + ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in + ${PROJECT_BINARY_DIR}/cmake/version.cmake + @ONLY +) + +SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}) +STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME) +SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION}) +ADD_CUSTOM_TARGET(dist + COMMAND cmake -E remove_directory ${ARCHIVE_NAME} + COMMAND hg archive ${ARCHIVE_NAME} + COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake + COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME} + COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME} + COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html + COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME} + COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME} + COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION} + COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION} + COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION} + COMMAND cmake -E remove_directory ${ARCHIVE_NAME} + COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION} + DEPENDS html + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + +# CPACK config (Basically for NSIS) IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) SET(CPACK_PACKAGE_VENDOR "EGRES")