]> git.lyx.org Git - lyx.git/blob - development/cmake/LyxPackaging.cmake
42df695e1b0b29b1ddbed2ae1f626709faf267bc
[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 # This is experimental, valid on _my_ system (Kornel)
36 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>= 4.4.3-0)")
37 if(ASPELL_FOUND)
38         set(CPACK_DEBIAN_PACKAGE_DEPENDS "libaspell15 (>= 0.60.6-1),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
39 endif()
40 if(ENCHANT_FOUND)
41         set(CPACK_DEBIAN_PACKAGE_DEPENDS "libenchant1c2a (>= 1.6.0-0),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
42 endif()
43 if(LYX_EXTERNAL_BOOST)
44         if(Boost_FOUND)
45                 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.40.0 (>= 1.40.0-4),libboost-signals1.40.0 (>= 1.40.0-4),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
46         endif()
47 endif()
48 #
49 # for the next ones, cpack insists on data with values in some file
50 set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_description.txt")
51 set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt")
52
53 # Use the revision number saved in ${LYX_PACKAGE_RELEASE}
54 # as the release in rpm-package-build.
55 # This way we maycan omit the otherwise needed "--force" parameter when
56 # installing from that rpm package.
57 set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
58 set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
59
60 # we do not have a readme or welcome data,
61 # so we do not provide infofiles for
62 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
63
64 # sources
65 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
66
67
68 set(CPACK_STRIP_FILES 1)
69
70 # Finaly give some hints about files not to be included in source package
71 SET(CPACK_SOURCE_IGNORE_FILES
72 "/CVS/"
73 "/\\\\.svn/"
74 "/\\\\.bzr/"
75 "/\\\\.hg/"
76 "/\\\\.git/"
77 "/\\\\.project$"
78 "/\\\\.cproject$"
79 "/\\\\.history$"
80 "\\\\.#"
81 "\\\\.swp$"
82 "~$"
83 "/#"
84 "/_CPack_Packages/"
85 "/CMakeCache.txt$"
86 "/CPackSourceConfig\\\\.cmake$"
87 "/configCompiler\\\\.h$"
88 "/install_manifest\\\\.txt$"
89 "/cmake_install\\\\.cmake$"
90 "/POTFILES"
91 "\\\\.tar\\\\.gz$"
92 "\\\\.tar\\\\.bz2$"
93 "\\\\.tar\\\\.Z$"
94 "\\\\.deb$"
95 "\\\\.rpm$"
96 "\\\\.rej$"
97 "\\\\.orig$"
98 "/core$"
99 "/CMakeFiles/"
100 "/Makefile\\\\.in$"
101 "/Makefile$"
102 "/autom4te\\\\.cache/"
103 "/\\\\.deps/"
104 "/build/"
105 "/lyx-2\\\\."
106 )
107
108 if(LYX_CPACK)
109         include(CPack)
110 endif()
111
112
113 #Now it is possible to create some packages
114 # cd <BuildDir>
115 # make package
116 #############################################################################################
117 # So, e.g. for variables
118 #    CMAKE_PROJECT_NAME                     : lyx
119 #    CPACK_PACKAGE_VERSION_MAJOR            : 2
120 #    CPACK_PACKAGE_VERSION_MINOR            : 0
121 #    CPACK_PACKAGE_VERSION_PATCH            : 1
122 #    CMAKE_SYSTEM_NAME                      : Linux
123 #    CPACK_BINARY_DEB:BOOL                  : ON
124 #
125 # the package name builds as "lyx-2.0.1-Linux.deb"
126 #
127 ############################## rpm ################################### deb ##################
128 # create    # cpack -G RPM --config CPackConfig.cmake   # cpack -G DEB --config CPackConfig.cmake
129 # creates =># lyx-2.0.1-Linux.rpm                       # lyx-2.0.1-Linux.deb
130 # list      # rpm -qlp lyx-2.0.1-Linux.rpm              # dpkg-deb -c lyx-2.0.1-Linux.deb
131 # install   # rpm -U lyx-2.0.1-Linux.rpm                # dpkg -i lyx-2.0.1-Linux.deb
132 #
133