Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 1 | |
| 2 | MACRO(GENERATE_PACKAGING PACKAGE VERSION) |
| 3 | |
| 4 | # The following components are regex's to match anywhere (unless anchored) |
| 5 | # in absolute path + filename to find files or directories to be excluded |
| 6 | # from source tarball. |
| 7 | SET (CPACK_SOURCE_IGNORE_FILES |
| 8 | #svn files |
| 9 | "\\\\.svn/" |
| 10 | "\\\\.cvsignore$" |
| 11 | # temporary files |
| 12 | "\\\\.swp$" |
| 13 | # backup files |
| 14 | "~$" |
| 15 | # eclipse files |
| 16 | "\\\\.cdtproject$" |
| 17 | "\\\\.cproject$" |
| 18 | "\\\\.project$" |
| 19 | "\\\\.settings/" |
| 20 | "\\\\.kdev4/" |
| 21 | "\\\\.kdev4$" |
| 22 | "\\\\.kdev4_include_paths$" |
| 23 | # others |
| 24 | "\\\\.#" |
| 25 | "/#" |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 26 | "/build/" |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 27 | "/autom4te\\\\.cache/" |
| 28 | "/_build/" |
| 29 | "/doc/html/" |
| 30 | "/\\\\.git/" |
| 31 | # used before |
| 32 | "/CVS/" |
| 33 | "/\\\\.libs/" |
| 34 | "/\\\\.deps/" |
| 35 | "\\\\.o$" |
| 36 | "\\\\.lo$" |
| 37 | "\\\\.la$" |
| 38 | "\\\\.sh$" |
| 39 | "Makefile\\\\.in$" |
| 40 | ) |
| 41 | |
| 42 | SET(CPACK_PACKAGE_VENDOR "Werner Dittmann") |
| 43 | #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") |
| 44 | #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") |
| 45 | #SET(CPACK_PACKAGE_VERSION_MAJOR ${version_major}) |
| 46 | #SET(CPACK_PACKAGE_VERSION_MINOR ${version_minor}) |
| 47 | #SET(CPACK_PACKAGE_VERSION_PATCH ${version_patch}) |
| 48 | SET( CPACK_GENERATOR "TBZ2") |
| 49 | SET( CPACK_SOURCE_GENERATOR "TBZ2") |
| 50 | SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" ) |
| 51 | INCLUDE(CPack) |
| 52 | |
| 53 | # SPECFILE() |
| 54 | |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 55 | ADD_CUSTOM_TARGET( svncheck |
| 56 | COMMAND cd $(CMAKE_SOURCE_DIR) && LC_ALL=C git status | grep -q "nothing to commit .working directory clean." |
| 57 | ) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 58 | |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 59 | SET( AUTOBUILD_COMMAND |
| 60 | COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2 |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 61 | COMMAND ${CMAKE_MAKE_PROGRAM} package_source |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 62 | COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package |
| 63 | COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 64 | # COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes" |
| 65 | ) |
| 66 | |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 67 | ADD_CUSTOM_TARGET( srcpackage_local |
| 68 | ${AUTOBUILD_COMMAND} |
| 69 | ) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 70 | |
Alexandre Lision | e24852d | 2014-02-04 13:13:02 -0500 | [diff] [blame^] | 71 | ADD_CUSTOM_TARGET( srcpackage |
| 72 | COMMAND ${CMAKE_MAKE_PROGRAM} svncheck |
| 73 | ${AUTOBUILD_COMMAND} |
| 74 | ) |
| 75 | ENDMACRO(GENERATE_PACKAGING) |