]> git.lyx.org Git - features.git/blob - development/cmake/LyxPackaging.cmake
Expand module names instead of buttons in settings
[features.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                 set(CPACK_DMG_BACKGROUND_IMAGE "${TOP_CMAKE_PATH}/../MacOSX/dmg-background.png")
10                 set(CPACK_DMG_DS_STORE "${CMAKE_BINARY_DIR}/ds_store/.DS_Store")
11         elseif(UNIX)
12                 set(CPACK_GENERATOR STGZ)
13         elseif(WIN32)
14                 set(CPACK_GENERATOR ZIP)
15         endif()
16 endif()
17
18 # Overwrite package name dependent on platform
19 # (Ignores the top project)
20 if(APPLE)
21         # true on all systems whre __APPLE__ is defined in header files
22         set(CPACK_PACKAGE_NAME "LyX${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
23 elseif(UNIX)
24         # True also for cygwin
25         set(CPACK_PACKAGE_NAME "lyx${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
26 else()
27         set(CPACK_PACKAGE_NAME "LyX${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
28 endif()
29
30 set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
31 set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
32 FILE(STRINGS "${TOP_CMAKE_PATH}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
33
34
35 set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
36
37 if (APPLE)
38         # We don't need absolute paths
39         set(CPACK_SET_DESTDIR "OFF")
40 elseif (NOT WIN32)
41         # needed by rpm
42         set(CPACK_SET_DESTDIR "ON")
43 endif()
44
45 FILE(READ "${TOP_CMAKE_PATH}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
46 set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
47 set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
48 #
49 # the next ones are needed by deb
50 set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
51 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
52
53 # We depend on python scripting
54 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python (>= 2.6)")
55
56 # use dpkg-shlibdeps to generate additional info for package dependency list.
57 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
58
59 #
60 # for the next ones, cpack insists on data with values in some file
61 set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_CMAKE_PATH}/LyX_description.txt")
62 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
63
64 # Use the revision number saved in ${LYX_PACKAGE_RELEASE}
65 # as the release in rpm-package-build.
66 # This way we maycan omit the otherwise needed "--force" parameter when
67 # installing from that rpm package.
68 set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
69 set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
70
71 # we do not have a readme or welcome data,
72 # so we do not provide infofiles for
73 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
74
75 # sources
76 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
77
78
79 set(CPACK_STRIP_FILES 1)
80
81 # Finaly give some hints about files not to be included in source package
82 SET(CPACK_SOURCE_IGNORE_FILES
83 "/CVS/"
84 "/\\\\.svn/"
85 "/\\\\.bzr/"
86 "/\\\\.hg/"
87 "/\\\\.git/"
88 "/\\\\.project$"
89 "/\\\\.cproject$"
90 "/\\\\.history$"
91 "\\\\.#"
92 "\\\\.swp$"
93 "~$"
94 "/#"
95 "/_CPack_Packages/"
96 "/CMakeCache.txt$"
97 "/CPackSourceConfig\\\\.cmake$"
98 "/configCompiler\\\\.h$"
99 "/install_manifest\\\\.txt$"
100 "/cmake_install\\\\.cmake$"
101 "/POTFILES"
102 "\\\\.tar\\\\.gz$"
103 "\\\\.tar\\\\.bz2$"
104 "\\\\.tar\\\\.Z$"
105 "\\\\.deb$"
106 "\\\\.rpm$"
107 "\\\\.rej$"
108 "\\\\.orig$"
109 "/core$"
110 "/CMakeFiles/"
111 "/Makefile\\\\.in$"
112 "/Makefile$"
113 "/autom4te\\\\.cache/"
114 "/\\\\.deps/"
115 "/build/"
116 "/lyx-2\\\\."
117 )
118
119 if(LYX_CPACK)
120         include(CPack)
121 endif()
122
123
124 #Now it is possible to create some packages
125 # cd <BuildDir>
126 # make package
127 #############################################################################################
128 # So, e.g. for variables
129 #    CMAKE_PROJECT_NAME                     : lyx
130 #    CPACK_PACKAGE_VERSION_MAJOR            : 2
131 #    CPACK_PACKAGE_VERSION_MINOR            : 0
132 #    CPACK_PACKAGE_VERSION_PATCH            : 1
133 #    CMAKE_SYSTEM_NAME                      : Linux
134 #    CPACK_BINARY_DEB:BOOL                  : ON
135 #
136 # the package name builds as "lyx-2.0.1-Linux.deb"
137 #
138 ############################## rpm ################################### deb ##################
139 # create    # cpack -G RPM --config CPackConfig.cmake   # cpack -G DEB --config CPackConfig.cmake
140 # creates =># lyx-2.0.1-Linux.rpm                       # lyx-2.0.1-Linux.deb
141 # list      # rpm -qlp lyx-2.0.1-Linux.rpm              # dpkg-deb -c lyx-2.0.1-Linux.deb
142 # install   # rpm -U lyx-2.0.1-Linux.rpm                # dpkg -i lyx-2.0.1-Linux.deb
143 #
144