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