summaryrefslogtreecommitdiff
path: root/cmake/Modules/GeneratePackage.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/GeneratePackage.cmake')
-rw-r--r--cmake/Modules/GeneratePackage.cmake75
1 files changed, 75 insertions, 0 deletions
diff --git a/cmake/Modules/GeneratePackage.cmake b/cmake/Modules/GeneratePackage.cmake
new file mode 100644
index 0000000..43a3d11
--- /dev/null
+++ b/cmake/Modules/GeneratePackage.cmake
@@ -0,0 +1,75 @@
+
+MACRO(GENERATE_PACKAGING PACKAGE VERSION)
+
+ # The following components are regex's to match anywhere (unless anchored)
+ # in absolute path + filename to find files or directories to be excluded
+ # from source tarball.
+ SET (CPACK_SOURCE_IGNORE_FILES
+ #svn files
+ "\\\\.svn/"
+ "\\\\.cvsignore$"
+ # temporary files
+ "\\\\.swp$"
+ # backup files
+ "~$"
+ # eclipse files
+ "\\\\.cdtproject$"
+ "\\\\.cproject$"
+ "\\\\.project$"
+ "\\\\.settings/"
+ "\\\\.kdev4/"
+ "\\\\.kdev4$"
+ "\\\\.kdev4_include_paths$"
+ # others
+ "\\\\.#"
+ "/#"
+ "/build/"
+ "/autom4te\\\\.cache/"
+ "/_build/"
+ "/doc/html/"
+ "/\\\\.git/"
+ # used before
+ "/CVS/"
+ "/\\\\.libs/"
+ "/\\\\.deps/"
+ "\\\\.o$"
+ "\\\\.lo$"
+ "\\\\.la$"
+ "\\\\.sh$"
+ "Makefile\\\\.in$"
+ )
+
+ SET(CPACK_PACKAGE_VENDOR "Werner Dittmann")
+ #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+ #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+ #SET(CPACK_PACKAGE_VERSION_MAJOR ${version_major})
+ #SET(CPACK_PACKAGE_VERSION_MINOR ${version_minor})
+ #SET(CPACK_PACKAGE_VERSION_PATCH ${version_patch})
+ SET( CPACK_GENERATOR "TBZ2")
+ SET( CPACK_SOURCE_GENERATOR "TBZ2")
+ SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
+ INCLUDE(CPack)
+
+# SPECFILE()
+
+ ADD_CUSTOM_TARGET( svncheck
+ COMMAND cd $(CMAKE_SOURCE_DIR) && LC_ALL=C git status | grep -q "nothing to commit .working directory clean."
+ )
+
+ SET( AUTOBUILD_COMMAND
+ COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2
+ COMMAND ${CMAKE_MAKE_PROGRAM} package_source
+ COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
+ COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
+# COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
+ )
+
+ ADD_CUSTOM_TARGET( srcpackage_local
+ ${AUTOBUILD_COMMAND}
+ )
+
+ ADD_CUSTOM_TARGET( srcpackage
+ COMMAND ${CMAKE_MAKE_PROGRAM} svncheck
+ ${AUTOBUILD_COMMAND}
+ )
+ENDMACRO(GENERATE_PACKAGING)