4 # http://cmake.org/cmake/help/cmake-2-8-docs.html#module:CPack
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")
12 set(CPACK_GENERATOR STGZ)
14 set(CPACK_GENERATOR ZIP)
18 # Overwrite package name dependent on platform
19 # (Ignores the top project)
21 # true on all systems whre __APPLE__ is defined in header files
22 set(CPACK_PACKAGE_NAME "LyX${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
24 # True also for cygwin
25 set(CPACK_PACKAGE_NAME "lyx${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
27 set(CPACK_PACKAGE_NAME "LyX${LYX_MAJOR_VERSION}${LYX_MINOR_VERSION}")
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)
35 set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
38 # We don't need absolute paths
39 set(CPACK_SET_DESTDIR "OFF")
41 set(CPACK_GENERATOR ZIP)
42 set(CPACK_BINARY_ZIP 1)
44 execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
45 get_filename_component(MINGW_RUNTIME_PATH ${GCC_LIBGCC} PATH)
46 file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/*.dll)
47 list(APPEND runtime ${GCC_RUNTIME} /usr/${LYX_XMINGW}/lib/libwinpthread-1.dll)
49 message(FATAL_ERROR "No mingw runtime found in ${MINGW_RUNTIME_PATH}")
52 if(LYX_USE_QT MATCHES "QT5")
53 get_target_property(qmakebin Qt5::qmake IMPORTED_LOCATION)
54 get_filename_component(QT_BINARY_DIR ${qmakebin} PATH)
57 ${QT_BINARY_DIR}/Qt5Core.dll
58 ${QT_BINARY_DIR}/Qt5Network.dll
59 ${QT_BINARY_DIR}/Qt5Gui.dll
60 ${QT_BINARY_DIR}/Qt5Widgets.dll
61 ${QT_BINARY_DIR}/Qt5Concurrent.dll
62 ${QT_BINARY_DIR}/Qt5OpenGL.dll
63 ${QT_BINARY_DIR}/Qt5PrintSupport.dll
64 ${QT_BINARY_DIR}/Qt5Svg.dll
65 ${QT_BINARY_DIR}/Qt5WinExtras.dll
67 CONFIGURATIONS Release)
69 ${QT_BINARY_DIR}/../plugins/platforms/qminimal.dll
70 ${QT_BINARY_DIR}/../plugins/platforms/qwindows.dll
71 DESTINATION bin/platforms
72 CONFIGURATIONS Release)
74 ${QT_BINARY_DIR}/../plugins/printsupport/windowsprintersupport.dll
75 DESTINATION bin/printsupport
76 CONFIGURATIONS Release)
78 ${QT_BINARY_DIR}/../plugins/imageformats/qgif.dll
79 ${QT_BINARY_DIR}/../plugins/imageformats/qjpeg.dll
80 ${QT_BINARY_DIR}/../plugins/imageformats/qsvg.dll
81 ${QT_BINARY_DIR}/../plugins/imageformats/qico.dll
82 DESTINATION bin/imageformats
83 CONFIGURATIONS Release)
85 ${QT_BINARY_DIR}/../plugins/iconengines/qsvgicon.dll
86 DESTINATION bin/iconengines
87 CONFIGURATIONS Release)
91 ${QT_BINARY_DIR}/QtCore4.dll
92 ${QT_BINARY_DIR}/QtGui4.dll
93 ${QT_BINARY_DIR}/QtNetwork4.dll
94 ${QT_PLUGINS_DIR}/imageformats/qgif4.dll
95 ${QT_PLUGINS_DIR}/imageformats/qico4.dll
96 ${QT_PLUGINS_DIR}/imageformats/qmng4.dll
97 ${QT_PLUGINS_DIR}/imageformats/qsvg4.dll
98 ${QT_PLUGINS_DIR}/imageformats/qtga4.dll
99 ${QT_PLUGINS_DIR}/imageformats/qtiff4.dll
100 DESTINATION bin CONFIGURATIONS Release)
105 set(CPACK_SET_DESTDIR "ON")
108 FILE(READ "${TOP_CMAKE_PATH}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
109 set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
110 set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
112 # the next ones are needed by deb
113 set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
114 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
116 # We depend on python scripting
117 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python (>= 2.6)")
119 # use dpkg-shlibdeps to generate additional info for package dependency list.
120 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
121 set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
124 # for the next ones, cpack insists on data with values in some file
125 set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_CMAKE_PATH}/LyX_description.txt")
126 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
128 # Use the revision number saved in ${LYX_PACKAGE_RELEASE}
129 # as the release in rpm-package-build.
130 # This way we maycan omit the otherwise needed "--force" parameter when
131 # installing from that rpm package.
132 set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
133 set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
135 # we do not have a readme or welcome data,
136 # so we do not provide infofiles for
137 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
140 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
143 set(CPACK_STRIP_FILES 1)
145 # Finaly give some hints about files not to be included in source package
146 SET(CPACK_SOURCE_IGNORE_FILES
161 "/CPackSourceConfig\\\\.cmake$"
162 "/configCompiler\\\\.h$"
163 "/install_manifest\\\\.txt$"
164 "/cmake_install\\\\.cmake$"
177 "/autom4te\\\\.cache/"
188 #Now it is possible to create some packages
191 #############################################################################################
192 # So, e.g. for variables
193 # CMAKE_PROJECT_NAME : lyx
194 # CPACK_PACKAGE_VERSION_MAJOR : 2
195 # CPACK_PACKAGE_VERSION_MINOR : 0
196 # CPACK_PACKAGE_VERSION_PATCH : 1
197 # CMAKE_SYSTEM_NAME : Linux
198 # CPACK_BINARY_DEB:BOOL : ON
200 # the package name builds as "lyx-2.0.1-Linux.deb"
202 ############################## rpm ################################### deb ##################
203 # create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake
204 # creates =># lyx-2.0.1-Linux.rpm # lyx-2.0.1-Linux.deb
205 # list # rpm -qlp lyx-2.0.1-Linux.rpm # dpkg-deb -c lyx-2.0.1-Linux.deb
206 # install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb