cmlib/CMLibCPackSources.cmake

12 lines
490 B
CMake

get_property(CPACK_PACKAGE_VERSION GLOBAL PROPERTY VERSION_STR)
set(CPACK_SOURCE_GENERATOR TXZ)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_IGNORE_FILE "cmake/etc/cpack_ignore.txt")
file(STRINGS ${CPACK_IGNORE_FILE} CPACK_SOURCE_IGNORE_FILES)
set_property(DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${CPACK_IGNORE_FILE})
include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)