Try to avoid use of perl, if there is no perl-command available

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29244 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Kornel Benko 2009-04-15 07:28:37 +00:00
parent 6f5ac86d6e
commit 7ad31fcf7b
2 changed files with 58 additions and 30 deletions

View File

@ -81,7 +81,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# don't use the default "/usr/local" # don't use the default "/usr/local"
# but respect the user-choice on the command-line # but respect the user-choice on the command-line
SET(CMAKE_INSTALL_PREFIX SET(CMAKE_INSTALL_PREFIX
"/usr/local/lyx${LYX_INSTALL_SUFFIX}" CACHE PATH "LyX install prefix" FORCE) "/usr/local/${project}${LYX_INSTALL_SUFFIX}" CACHE PATH "LyX install prefix" FORCE)
endif() endif()
if(WIN32) if(WIN32)
SET(CMAKE_INSTALL_PREFIX SET(CMAKE_INSTALL_PREFIX
@ -356,11 +356,14 @@ if(MSVC)
endif() endif()
FIND_PROGRAM(_PERL_EXECUTABLE perl)
if(NOT ${_PERL_EXECUTABLE} MATCHES "-NOTFOUND")
if(nls OR all) if(nls OR all)
find_package(LyXGettext REQUIRED) find_package(LyXGettext REQUIRED)
include_directories(${TOP_SRC_DIR}/po) include_directories(${TOP_SRC_DIR}/po)
add_subdirectory(po) add_subdirectory(po)
endif() endif()
endif()
# compiler tests, config.h generation # compiler tests, config.h generation
if(MSVC AND NOT CONFIGURECHECKS) if(MSVC AND NOT CONFIGURECHECKS)
@ -387,7 +390,9 @@ endif()
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(man) add_subdirectory(man)
if(NOT ${_PERL_EXECUTABLE} MATCHES "-NOTFOUND")
add_subdirectory(doc) add_subdirectory(doc)
endif()
add_subdirectory(lyx2lyx) add_subdirectory(lyx2lyx)
add_subdirectory(scripts) add_subdirectory(scripts)
@ -396,7 +401,6 @@ include(../Install)
SET(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}") SET(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}") SET(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
FILE(STRINGS "${TOP_SRC_DIR}/development/cmake/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY) FILE(STRINGS "${TOP_SRC_DIR}/development/cmake/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)
#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A WYSIWYM (What You See Is What You Mean) document processor")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${LYX_INSTALL_SUFFIX}")
# #
@ -408,9 +412,15 @@ SET(CPACK_RPM_PACKAGE_VENDOR "The LyX team")
# #
# the next ones are needed by deb # the next ones are needed by deb
SET(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}") SET(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "lyx-${LYX_INSTALL_SUFFIX}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${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()
# #
# for the next ones, cmake insists on data with values in some file # for the next ones, cpack insists on data with values in some file
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/development/cmake/LyX_description.txt") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${TOP_SRC_DIR}/development/cmake/LyX_description.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/development/cmake/LyX_license.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/development/cmake/LyX_license.txt")
@ -418,7 +428,14 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/development/cmake/LyX_license.tx
# This way we may omit the otherwise needed "--force" parameter when # This way we may omit the otherwise needed "--force" parameter when
# installing from that rpm package. # installing from that rpm package.
FIND_PROGRAM(_svnversion svnversion) FIND_PROGRAM(_svnversion svnversion)
message(STATUS "svnversion = ${_svnversion}")
if(NOT ${_svnversion} MATCHES "-NOTFOUND")
EXECUTE_PROCESS(COMMAND ${_svnversion} WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${_svnversion} WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
# We use this value also to set the package-patch-value
if(CPACK_RPM_PACKAGE_RELEASE MATCHES "^\([0-9]+\)")
set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_1})
endif()
endif()
# we do not have a readme or welcome data, # we do not have a readme or welcome data,
# so we do not provide infofiles for # so we do not provide infofiles for
@ -428,9 +445,20 @@ include(CPack)
#Now it is possible to create some packages #Now it is possible to create some packages
# cd <BuildDir> # cd <BuildDir>
# make package # 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 ################## ############################## rpm ################################### deb ##################
# create # cpack -G RPM --config CPackConfig.cmake # cpack -G DEB --config CPackConfig.cmake # 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 # 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 # 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 # install # rpm -U lyx-2.0.1-Linux.rpm # dpkg -i lyx-2.0.1-Linux.deb
# #

View File

@ -52,7 +52,7 @@ FIND_PROGRAM(GETTEXT_MSGUNIQ_EXECUTABLE msguniq)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot"
COMMAND perl COMMAND ${_PERL_EXECUTABLE}
ARGS -e "\"while(<>){print;}\"" ${_py_sources} > "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot" ARGS -e "\"while(<>){print;}\"" ${_py_sources} > "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot"
DEPENDS ${_py_sources} DEPENDS ${_py_sources}
) )