mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Cpack variables and package creation transfered to LyxPackaging.cmake
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38808 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4fb3e19aa7
commit
b0716b0f13
@ -110,8 +110,8 @@ if(LYX_CPACK)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LYX_DMG)
|
if(LYX_DMG)
|
||||||
set(LYX_BUNDLE 1)
|
set(LYX_BUNDLE ON)
|
||||||
set(LYX_CPACK 1)
|
set(LYX_CPACK ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LYX_INSTALL)
|
if(LYX_INSTALL)
|
||||||
@ -241,14 +241,13 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
if(LYX_BUNDLE)
|
if(LYX_BUNDLE)
|
||||||
set(LYX_CPACK 1)
|
set(LYX_CPACK ON)
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
message(STATUS "Bundle creation is enabled (experimental):")
|
message(STATUS "Bundle creation is enabled (experimental):")
|
||||||
message(STATUS " make")
|
message(STATUS " make")
|
||||||
message(STATUS " make install/strip")
|
message(STATUS " make install/strip")
|
||||||
message(STATUS " make package")
|
message(STATUS " make package")
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(CPACK_GENERATOR DragNDrop)
|
|
||||||
set(LYX_BUILD_BUNDLE MACOSX_BUNDLE)
|
set(LYX_BUILD_BUNDLE MACOSX_BUNDLE)
|
||||||
set(LYX_DATA_SUBDIR ${PACKAGE_BASE}${PROGRAM_SUFFIX}.app/Contents/Resources/ CACHE STRING "Bundle Contents dir" FORCE)
|
set(LYX_DATA_SUBDIR ${PACKAGE_BASE}${PROGRAM_SUFFIX}.app/Contents/Resources/ CACHE STRING "Bundle Contents dir" FORCE)
|
||||||
set(MACOSX_BUNDLE_STARTUP_COMMAND ${PACKAGE_BASE}${PROGRAM_SUFFIX}.app)
|
set(MACOSX_BUNDLE_STARTUP_COMMAND ${PACKAGE_BASE}${PROGRAM_SUFFIX}.app)
|
||||||
@ -257,17 +256,14 @@ if(LYX_BUNDLE)
|
|||||||
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
endif()
|
endif()
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
set(CPACK_GENERATOR STGZ)
|
|
||||||
message(STATUS "To embed Qt in this bundle don't build with your system Qt:")
|
message(STATUS "To embed Qt in this bundle don't build with your system Qt:")
|
||||||
message(STATUS " - fix PATH so a other qmake is found by cmake")
|
message(STATUS " - fix PATH so a other qmake is found by cmake")
|
||||||
message(STATUS " - fix LD_LIBRARY_PATH so lyx doesn't use system's Qt")
|
message(STATUS " - fix LD_LIBRARY_PATH so lyx doesn't use system's Qt")
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(CPACK_GENERATOR ZIP)
|
|
||||||
message(STATUS "A zipped-only release could be created by building the 'PACKAGE' project")
|
message(STATUS "A zipped-only release could be created by building the 'PACKAGE' project")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(LYX_INSTALL_PREFIX)
|
if(LYX_INSTALL_PREFIX)
|
||||||
set(CMAKE_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice install prefix" FORCE)
|
set(CMAKE_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice install prefix" FORCE)
|
||||||
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
@ -281,7 +277,6 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
# see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
|
# see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
@ -640,92 +635,8 @@ if(LYX_NLS)
|
|||||||
message(STATUS)
|
message(STATUS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include("${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyxPackaging.cmake")
|
||||||
|
|
||||||
# CPack packaging
|
|
||||||
#
|
|
||||||
# http://cmake.org/cmake/help/cmake-2-8-docs.html#module:CPack
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
|
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
|
|
||||||
FILE(STRINGS "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
|
||||||
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
|
|
||||||
|
|
||||||
#
|
|
||||||
# needed by rpm
|
|
||||||
set(CPACK_SET_DESTDIR "ON")
|
|
||||||
FILE(READ "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
|
|
||||||
set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
|
|
||||||
set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
|
|
||||||
#
|
|
||||||
# the next ones are needed by deb
|
|
||||||
set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
|
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
|
|
||||||
|
|
||||||
# This is experimental, valid on _my_ system (Kornel)
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>= 4.4.3-0)")
|
|
||||||
if(ASPELL_FOUND)
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libaspell15 (>= 0.60.6-1),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
|
||||||
endif()
|
|
||||||
if(ENCHANT_FOUND)
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libenchant1c2a (>= 1.6.0-0),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
|
||||||
endif()
|
|
||||||
if(LYX_EXTERNAL_BOOST)
|
|
||||||
if(Boost_FOUND)
|
|
||||||
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}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
#
|
|
||||||
# for the next ones, cpack insists on data with values in some file
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_description.txt")
|
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt")
|
|
||||||
|
|
||||||
# Use the revision number saved in ${LYX_PACKAGE_RELEASE}
|
|
||||||
# as the release in rpm-package-build.
|
|
||||||
# This way we maycan omit the otherwise needed "--force" parameter when
|
|
||||||
# installing from that rpm package.
|
|
||||||
set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
|
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
|
|
||||||
|
|
||||||
# we do not have a readme or welcome data,
|
|
||||||
# so we do not provide infofiles for
|
|
||||||
# CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
|
|
||||||
|
|
||||||
# sources
|
|
||||||
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
|
|
||||||
|
|
||||||
|
|
||||||
set(CPACK_STRIP_FILES 1)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(LYX_CPACK)
|
|
||||||
include(CPack)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#Now it is possible to create some packages
|
|
||||||
# cd <BuildDir>
|
|
||||||
# make package
|
|
||||||
#############################################################################################
|
|
||||||
# So, e.g. for variables
|
|
||||||
# CMAKE_PROJECT_NAME : lyx
|
|
||||||
# CPACK_PACKAGE_VERSION_MAJOR : 2
|
|
||||||
# CPACK_PACKAGE_VERSION_MINOR : 0
|
|
||||||
# CPACK_PACKAGE_VERSION_PATCH : 1
|
|
||||||
# CMAKE_SYSTEM_NAME : Linux
|
|
||||||
# CPACK_BINARY_DEB:BOOL : ON
|
|
||||||
#
|
|
||||||
# the package name builds as "lyx-2.0.1-Linux.deb"
|
|
||||||
#
|
|
||||||
############################## rpm ################################### deb ##################
|
|
||||||
# create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake
|
|
||||||
# creates =># lyx-2.0.1-Linux.rpm # lyx-2.0.1-Linux.deb
|
|
||||||
# list # rpm -qlp lyx-2.0.1-Linux.rpm # dpkg-deb -c lyx-2.0.1-Linux.deb
|
|
||||||
# install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb
|
|
||||||
#
|
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
|
|
||||||
endif() #help
|
endif() # help
|
||||||
|
|
||||||
|
97
development/cmake/LyxPackaging.cmake
Normal file
97
development/cmake/LyxPackaging.cmake
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
|
||||||
|
# CPack packaging
|
||||||
|
#
|
||||||
|
# http://cmake.org/cmake/help/cmake-2-8-docs.html#module:CPack
|
||||||
|
|
||||||
|
if(LYX_BUNDLE)
|
||||||
|
if(APPLE)
|
||||||
|
set(CPACK_GENERATOR DragNDrop)
|
||||||
|
elseif(UNIX)
|
||||||
|
set(CPACK_GENERATOR STGZ)
|
||||||
|
elseif(WIN32)
|
||||||
|
set(CPACK_GENERATOR ZIP)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
|
||||||
|
set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
|
||||||
|
FILE(STRINGS "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||||
|
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
|
||||||
|
|
||||||
|
#
|
||||||
|
# needed by rpm
|
||||||
|
set(CPACK_SET_DESTDIR "ON")
|
||||||
|
FILE(READ "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt" CPACK_RPM_PACKAGE_LICENSE)
|
||||||
|
set(CPACK_RPM_PACKAGE_GROUP "Applications/Publishing")
|
||||||
|
set(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
|
||||||
|
#
|
||||||
|
# the next ones are needed by deb
|
||||||
|
set(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
|
||||||
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${LYX_PROJECT}-${LYX_INSTALL_SUFFIX}")
|
||||||
|
|
||||||
|
# This is experimental, valid on _my_ system (Kornel)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>= 4.4.3-0)")
|
||||||
|
if(ASPELL_FOUND)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libaspell15 (>= 0.60.6-1),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
||||||
|
endif()
|
||||||
|
if(ENCHANT_FOUND)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libenchant1c2a (>= 1.6.0-0),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
||||||
|
endif()
|
||||||
|
if(LYX_EXTERNAL_BOOST)
|
||||||
|
if(Boost_FOUND)
|
||||||
|
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}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
# for the next ones, cpack insists on data with values in some file
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_description.txt")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt")
|
||||||
|
|
||||||
|
# Use the revision number saved in ${LYX_PACKAGE_RELEASE}
|
||||||
|
# as the release in rpm-package-build.
|
||||||
|
# This way we maycan omit the otherwise needed "--force" parameter when
|
||||||
|
# installing from that rpm package.
|
||||||
|
set(CPACK_RPM_PACKAGE_RELEASE ${LYX_PACKAGE_RELEASE})
|
||||||
|
set(CPACK_PACKAGE_VERSION_PATCH ${LYX_REVISION_VERSION})
|
||||||
|
|
||||||
|
# we do not have a readme or welcome data,
|
||||||
|
# so we do not provide infofiles for
|
||||||
|
# CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
|
||||||
|
|
||||||
|
# sources
|
||||||
|
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-archive.com/cmake@cmake.org/msg33720.html
|
||||||
|
|
||||||
|
|
||||||
|
set(CPACK_STRIP_FILES 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(LYX_CPACK)
|
||||||
|
include(CPack)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
#Now it is possible to create some packages
|
||||||
|
# cd <BuildDir>
|
||||||
|
# make package
|
||||||
|
#############################################################################################
|
||||||
|
# So, e.g. for variables
|
||||||
|
# CMAKE_PROJECT_NAME : lyx
|
||||||
|
# CPACK_PACKAGE_VERSION_MAJOR : 2
|
||||||
|
# CPACK_PACKAGE_VERSION_MINOR : 0
|
||||||
|
# CPACK_PACKAGE_VERSION_PATCH : 1
|
||||||
|
# CMAKE_SYSTEM_NAME : Linux
|
||||||
|
# CPACK_BINARY_DEB:BOOL : ON
|
||||||
|
#
|
||||||
|
# the package name builds as "lyx-2.0.1-Linux.deb"
|
||||||
|
#
|
||||||
|
############################## rpm ################################### deb ##################
|
||||||
|
# create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake
|
||||||
|
# creates =># lyx-2.0.1-Linux.rpm # lyx-2.0.1-Linux.deb
|
||||||
|
# list # rpm -qlp lyx-2.0.1-Linux.rpm # dpkg-deb -c lyx-2.0.1-Linux.deb
|
||||||
|
# install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb
|
||||||
|
#
|
||||||
|
|
Loading…
Reference in New Issue
Block a user