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 get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
46 if(LYX_USE_QT MATCHES "QT4")
47 get_filename_component(mingw_name ${LYX_XMINGW} NAME)
48 set(MINGW_BIN_PATH ${MINGW_BIN_PATH}/../${mingw_name}/lib)
49 set(MINGW_LIB_PATH ${MINGW_BIN_PATH})
51 set(MINGW_BIN_PATH /usr/lib/gcc/${LYX_XMINGW}/${GCC_VERSION})
52 set(MINGW_LIB_PATH /usr/${LYX_XMINGW}/lib)
55 if(EXISTS ${MINGW_BIN_PATH}/libgcc_s_sjlj-1.dll)
56 list(APPEND runtime ${MINGW_BIN_PATH}/libgcc_s_sjlj-1.dll)
57 elseif(EXISTS ${MINGW_BIN_PATH}/libgcc_s_seh-1.dll)
58 list(APPEND runtime ${MINGW_BIN_PATH}/libgcc_s_seh-1.dll)
59 elseif(EXISTS ${MINGW_BIN_PATH}/libgcc_s_dw2-1.dll)
60 list(APPEND runtime ${MINGW_BIN_PATH}/libgcc_s_dw2-1.dll)
62 if(EXISTS ${MINGW_BIN_PATH}/libstdc++-6.dll)
63 list(APPEND runtime ${MINGW_BIN_PATH}/libstdc++-6.dll)
65 if(EXISTS ${MINGW_LIB_PATH}/libwinpthread-1.dll)
66 list(APPEND runtime ${MINGW_LIB_PATH}/libwinpthread-1.dll)
69 message(FATAL_ERROR "No mingw runtime found in ${MINGW_BIN_PATH}")
72 if(LYX_USE_QT MATCHES "QT5")
73 get_target_property(qmakebin Qt5::qmake IMPORTED_LOCATION)
74 get_filename_component(QT_BINARY_DIR ${qmakebin} PATH)
77 ${QT_BINARY_DIR}/Qt5Core.dll
78 ${QT_BINARY_DIR}/Qt5Network.dll
79 ${QT_BINARY_DIR}/Qt5Gui.dll
80 ${QT_BINARY_DIR}/Qt5Widgets.dll
81 ${QT_BINARY_DIR}/Qt5Concurrent.dll
82 ${QT_BINARY_DIR}/Qt5OpenGL.dll
83 ${QT_BINARY_DIR}/Qt5PrintSupport.dll
84 ${QT_BINARY_DIR}/Qt5Svg.dll
85 ${QT_BINARY_DIR}/Qt5WinExtras.dll
87 CONFIGURATIONS Release)
89 ${QT_BINARY_DIR}/../plugins/platforms/qminimal.dll
90 ${QT_BINARY_DIR}/../plugins/platforms/qwindows.dll
91 DESTINATION bin/platforms
92 CONFIGURATIONS Release)
94 ${QT_BINARY_DIR}/../plugins/printsupport/windowsprintersupport.dll
95 DESTINATION bin/printsupport
96 CONFIGURATIONS Release)
98 ${QT_BINARY_DIR}/../plugins/imageformats/qgif.dll
99 ${QT_BINARY_DIR}/../plugins/imageformats/qjpeg.dll
100 ${QT_BINARY_DIR}/../plugins/imageformats/qsvg.dll
101 ${QT_BINARY_DIR}/../plugins/imageformats/qico.dll
102 DESTINATION bin/imageformats
103 CONFIGURATIONS Release)
105 ${QT_BINARY_DIR}/../plugins/iconengines/qsvgicon.dll
106 DESTINATION bin/iconengines
107 CONFIGURATIONS Release)
111 ${QT_BINARY_DIR}/QtCore4.dll
112 ${QT_BINARY_DIR}/QtGui4.dll
113 ${QT_BINARY_DIR}/QtNetwork4.dll
114 ${QT_PLUGINS_DIR}/imageformats/qgif4.dll
115 ${QT_PLUGINS_DIR}/imageformats/qico4.dll
116 ${QT_PLUGINS_DIR}/imageformats/qmng4.dll
117 ${QT_PLUGINS_DIR}/imageformats/qsvg4.dll
118 ${QT_PLUGINS_DIR}/imageformats/qtga4.dll
119 ${QT_PLUGINS_DIR}/imageformats/qtiff4.dll
120 DESTINATION bin CONFIGURATIONS Release)
125 set(CPACK_SET_DESTDIR "ON")
128 FILE(READ "${TOP_CMAKE_PATH}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
129 set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
130 set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
132 # the next ones are needed by deb
133 set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
134 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
136 # We depend on python scripting
137 set(CPACK_DEBIAN_PACKAGE_DEPENDS "python (>= 2.6)")
139 # use dpkg-shlibdeps to generate additional info for package dependency list.
140 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
141 set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
144 # for the next ones, cpack insists on data with values in some file
145 set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_CMAKE_PATH}/LyX_description.txt")
146 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
148 # Use the revision number saved in ${LYX_PACKAGE_RELEASE}
149 # as the release in rpm-package-build.
150 # This way we maycan omit the otherwise needed "--force" parameter when
151 # installing from that rpm package.
152 set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
153 set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
155 # we do not have a readme or welcome data,
156 # so we do not provide infofiles for
157 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
160 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
163 set(CPACK_STRIP_FILES 1)
165 # Finaly give some hints about files not to be included in source package
166 SET(CPACK_SOURCE_IGNORE_FILES
181 "/CPackSourceConfig\\\\.cmake$"
182 "/configCompiler\\\\.h$"
183 "/install_manifest\\\\.txt$"
184 "/cmake_install\\\\.cmake$"
197 "/autom4te\\\\.cache/"
208 #Now it is possible to create some packages
211 #############################################################################################
212 # So, e.g. for variables
213 # CMAKE_PROJECT_NAME : lyx
214 # CPACK_PACKAGE_VERSION_MAJOR : 2
215 # CPACK_PACKAGE_VERSION_MINOR : 0
216 # CPACK_PACKAGE_VERSION_PATCH : 1
217 # CMAKE_SYSTEM_NAME : Linux
218 # CPACK_BINARY_DEB:BOOL : ON
220 # the package name builds as "lyx-2.0.1-Linux.deb"
222 ############################## rpm ################################### deb ##################
223 # create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake
224 # creates =># lyx-2.0.1-Linux.rpm # lyx-2.0.1-Linux.deb
225 # list # rpm -qlp lyx-2.0.1-Linux.rpm # dpkg-deb -c lyx-2.0.1-Linux.deb
226 # install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb