blob: 43a3d11ef5793bf4e5668baf5d76d6d3256a4074 [file] [log] [blame]
Alexandre Lision51140e12013-12-02 10:54:09 -05001
2MACRO(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 Lisione24852d2014-02-04 13:13:02 -050026 "/build/"
Alexandre Lision51140e12013-12-02 10:54:09 -050027 "/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 Lisione24852d2014-02-04 13:13:02 -050055 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 Lision51140e12013-12-02 10:54:09 -050058
Alexandre Lisione24852d2014-02-04 13:13:02 -050059 SET( AUTOBUILD_COMMAND
60 COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2
Alexandre Lision51140e12013-12-02 10:54:09 -050061 COMMAND ${CMAKE_MAKE_PROGRAM} package_source
Alexandre Lisione24852d2014-02-04 13:13:02 -050062 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 Lision51140e12013-12-02 10:54:09 -050064# COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
65 )
66
Alexandre Lisione24852d2014-02-04 13:13:02 -050067 ADD_CUSTOM_TARGET( srcpackage_local
68 ${AUTOBUILD_COMMAND}
69 )
Alexandre Lision51140e12013-12-02 10:54:09 -050070
Alexandre Lisione24852d2014-02-04 13:13:02 -050071 ADD_CUSTOM_TARGET( srcpackage
72 COMMAND ${CMAKE_MAKE_PROGRAM} svncheck
73 ${AUTOBUILD_COMMAND}
74 )
75ENDMACRO(GENERATE_PACKAGING)