]> git.lyx.org Git - lyx.git/blob - development/cmake/LyxPackaging.cmake
b2abeaa1466d706d7ba4ac215246ef984ef31488
[lyx.git] / development / cmake / LyxPackaging.cmake
1
2 # CPack packaging
3 #
4 # http://cmake.org/cmake/help/cmake-2-8-docs.html#module:CPack
5
6 if(LYX_BUNDLE)
7         if(APPLE)
8                 set(CPACK_GENERATOR DragNDrop)
9         elseif(UNIX)
10                 set(CPACK_GENERATOR STGZ)
11         elseif(WIN32)
12                 set(CPACK_GENERATOR ZIP)
13         endif()
14 endif()
15
16
17 set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
18 set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
19 FILE(STRINGS "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
20
21
22 set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
23
24 #
25 # needed by rpm
26 set(CPACK_SET_DESTDIR "ON")
27 FILE(READ "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
28 set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
29 set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
30 #
31 # the next ones are needed by deb
32 set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
33 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
34
35 # use dpkg-shlibdeps to generate package dependency list.
36 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
37
38 #
39 # for the next ones, cpack insists on data with values in some file
40 set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_description.txt")
41 set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt")
42
43 # Use the revision number saved in ${LYX_PACKAGE_RELEASE}
44 # as the release in rpm-package-build.
45 # This way we maycan omit the otherwise needed "--force" parameter when
46 # installing from that rpm package.
47 set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
48 set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
49
50 # we do not have a readme or welcome data,
51 # so we do not provide infofiles for
52 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
53
54 # sources
55 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
56
57
58 set(CPACK_STRIP_FILES 1)
59
60 # Finaly give some hints about files not to be included in source package
61 SET(CPACK_SOURCE_IGNORE_FILES
62 "/CVS/"
63 "/\\\\.svn/"
64 "/\\\\.bzr/"
65 "/\\\\.hg/"
66 "/\\\\.git/"
67 "/\\\\.project$"
68 "/\\\\.cproject$"
69 "/\\\\.history$"
70 "\\\\.#"
71 "\\\\.swp$"
72 "~$"
73 "/#"
74 "/_CPack_Packages/"
75 "/CMakeCache.txt$"
76 "/CPackSourceConfig\\\\.cmake$"
77 "/configCompiler\\\\.h$"
78 "/install_manifest\\\\.txt$"
79 "/cmake_install\\\\.cmake$"
80 "/POTFILES"
81 "\\\\.tar\\\\.gz$"
82 "\\\\.tar\\\\.bz2$"
83 "\\\\.tar\\\\.Z$"
84 "\\\\.deb$"
85 "\\\\.rpm$"
86 "\\\\.rej$"
87 "\\\\.orig$"
88 "/core$"
89 "/CMakeFiles/"
90 "/Makefile\\\\.in$"
91 "/Makefile$"
92 "/autom4te\\\\.cache/"
93 "/\\\\.deps/"
94 "/build/"
95 "/lyx-2\\\\."
96 )
97
98 if(LYX_CPACK)
99         include(CPack)
100 endif()
101
102
103 #Now it is possible to create some packages
104 # cd <BuildDir>
105 # make package
106 #############################################################################################
107 # So, e.g. for variables
108 #    CMAKE_PROJECT_NAME                     : lyx
109 #    CPACK_PACKAGE_VERSION_MAJOR            : 2
110 #    CPACK_PACKAGE_VERSION_MINOR            : 0
111 #    CPACK_PACKAGE_VERSION_PATCH            : 1
112 #    CMAKE_SYSTEM_NAME                      : Linux
113 #    CPACK_BINARY_DEB:BOOL                  : ON
114 #
115 # the package name builds as "lyx-2.0.1-Linux.deb"
116 #
117 ############################## rpm ################################### deb ##################
118 # create    # cpack -G RPM --config CPackConfig.cmake   # cpack -G DEB --config CPackConfig.cmake
119 # creates =># lyx-2.0.1-Linux.rpm                       # lyx-2.0.1-Linux.deb
120 # list      # rpm -qlp lyx-2.0.1-Linux.rpm              # dpkg-deb -c lyx-2.0.1-Linux.deb
121 # install   # rpm -U lyx-2.0.1-Linux.rpm                # dpkg -i lyx-2.0.1-Linux.deb
122 #
123