]> git.lyx.org Git - features.git/commitdiff
cmake: generate ready-to-use nsis files
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 21 May 2011 09:50:41 +0000 (09:50 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 21 May 2011 09:50:41 +0000 (09:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38796 a592a061-630c-0410-9148-cb99ea01b6c8

CMakeLists.txt
development/Win32/packaging/installer/include/declarations.nsh.cmake
development/Win32/packaging/installer/lyx.nsi.cmake
development/Win32/packaging/installer/settings.nsh.cmake

index 8e4e2edc48c32a3771afc602fc4bf9d5f0d0df34..a98df1a2506f3e4c201970e469de014f56ac047e 100644 (file)
@@ -118,6 +118,7 @@ if(LYX_INSTALL)
        set(LYX_NLS ON)
        if (WIN32)
                set(LYX_HUNSPELL ON)
+               set(LYX_BUNDLE ON)
        endif()
        set(LYX_CONSOLE OFF)
        set(LYX_PACKAGE_SUFFIX ON)
@@ -208,6 +209,7 @@ foreach(_c_l ${_config_lines} )
                if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\).*$")
                        set(LYX_MAJOR_VERSION ${CMAKE_MATCH_1})
                        set(LYX_MINOR_VERSION ${CMAKE_MATCH_2})
+                       set(LYX_PATCH_VERSION 0) # TODO 2.1.0svn, LYX_PATCH_VERSION == 0
                        set(LYX_DIR_VER "LYX_DIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
                        set(LYX_USERDIR_VER "LYX_USERDIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
                        set(LYX_INSTALL_SUFFIX "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
@@ -278,6 +280,13 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
                set(CMAKE_INSTALL_PREFIX LYX_INSTALLED CACHE PATH "LyX default install prefix" FORCE)
        endif()
 endif()
+if(IS_ABSOLUTE)
+       set(CMAKE_INSTALL_PREFIX_ABSOLUTE ${CMAKE_INSTALL_PREFIX})
+else()
+       set(CMAKE_INSTALL_PREFIX_ABSOLUTE ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX})
+endif()
+
+
 
 if(NOT LYX_DATA_SUBDIR)
        if (WIN32)
@@ -657,14 +666,18 @@ set(CPACK_RESOURCE_FILE_LICENSE "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_license.txt
 # installing from that rpm package.
 FIND_PROGRAM(LYX_SVNVERSION svnversion)
 #message(STATUS "svnversion = ${LYX_SVNVERSION}")
-if(NOT ${LYX_SVNVERSION} MATCHES "-NOTFOUND")
+if(LYX_SVNVERSION)
        EXECUTE_PROCESS(COMMAND ${LYX_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})
+               set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_1}) # TODO this is not the patch level
+               set(LYX_REVISION_VERSION ${CMAKE_MATCH_1})
        endif()
+else()
+       set(LYX_REVISION_VERSION svn) #TODO use date
 endif()
 
+
 # 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
@@ -682,17 +695,24 @@ set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${TOP_SRC_DIR};/") # http://www.mail-arc
 set(CPACK_SOURCE_GENERATOR TGZ ZIP TBZ2)
 
 
-set(CPACK_PACKAGE_NAME LyX)
-if(APPLE)
-       set(CPACK_GENERATOR DragNDrop)  
-elseif(WIN32)
-       set(CPACK_GENERATOR ZIP)
-       #TODO set(CPACK_GENERATOR ZIP NSIS)
-elseif()
-       # .sh on linux?
-endif()
-
 if(LYX_CPACK)
+
+       set(CPACK_PACKAGE_NAME LyX)
+       if(APPLE)
+               set(CPACK_GENERATOR DragNDrop)  
+       elseif(WIN32)
+               message(STATUS "Configuring NSIS files")
+               configure_file(development/Win32/packaging/installer/lyx.nsi.cmake ${CMAKE_BINARY_DIR}/installer/lyx.nsi @ONLY)
+               configure_file(development/Win32/packaging/installer/settings.nsh.cmake ${CMAKE_BINARY_DIR}/installer/settings-cmake.nsh @ONLY)
+               configure_file(development/Win32/packaging/installer/include/declarations.nsh.cmake ${CMAKE_BINARY_DIR}/installer/declarations-cmake.nsh @ONLY)
+               set(CPACK_GENERATOR ZIP)
+               message(STATUS "NSIS files are created in ${CMAKE_BINARY_DIR}/installer")
+               message(STATUS "A zipped only release could be created by building the 'PACKAGE' project")
+       elseif()
+               # .sh on linux?
+       endif()
+
+
        include(CPack)
 endif()
 
index b9154bb3e3515628c6edb07a631f10db18d3b18a..fc7eaf440c3403d7afc8222dd5dd2cfd38bb0d52 100644 (file)
@@ -11,8 +11,8 @@ SetCompressor /SOLID lzma
 #--------------------------------
 # File locations
 
-!define FILES_LICENSE "license.rtf"
-!define FILES_ICONS "..\icons"
+!define FILES_LICENSE "${FILES_INSTALLER}\license.rtf"
+!define FILES_ICONS "${FILES_INSTALLER}\..\icons"
 !define FILES_PDFVIEW "${FILES_DEPS}\bin"
 !define FILES_MSVC "${FILES_DEPS}\bin"
 !define FILES_PYTHON "${FILES_DEPS}\python"
@@ -41,7 +41,7 @@ SetCompressor /SOLID lzma
 # Names and version
 
 !define APP_NAME "LyX"
-!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}.${APP_VERSION_BUILD}"
+!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}.${APP_VERSION_REVISION}"
 !define APP_SERIES_NAME "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
 !define APP_SERIES_KEY "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}"
 !define APP_DIR "${APP_NAME}${APP_SERIES_KEY}"
@@ -82,8 +82,8 @@ SetCompressor /SOLID lzma
 !endif
 
 !define SETUP_ICON "${FILES_ICONS}\lyx.ico"
-!define SETUP_HEADERIMAGE "graphics\header.bmp"
-!define SETUP_WIZARDIMAGE "graphics\wizard.bmp"
+!define SETUP_HEADERIMAGE "${FILES_INSTALLER}\graphics\header.bmp"
+!define SETUP_WIZARDIMAGE "${FILES_INSTALLER}\graphics\wizard.bmp"
 !define SETUP_UNINSTALLER "Uninstall-${APP_NAME}.exe"
 !define SETUP_UNINSTALLER_KEY "${APP_NAME}${APP_SERIES_KEY}"
 
index 4c5e85c69ae6f12e2bd546d84b8acc516ef48c69..3b0c24a9c6abd61b77b087550ed2c0661232c5dc 100644 (file)
@@ -6,9 +6,11 @@ Compatible with NSIS 2.46
 
 */
 
-!include settings.nsh
+!addincludedir @CMAKE_SOURCE_DIR@/development/Win32/packaging/installer
+
+!include settings-cmake.nsh
+!include declarations-cmake.nsh
 
-!include include\declarations.nsh
 !include include\variables.nsh
 !include include\nsis.nsh
 !include include\filelist.nsh
index 4e3ab349be91a9fb3d3c084bbc88f48ea9285469..e79fcef4aeff6d917829d0f3b206768b61a98305 100644 (file)
@@ -9,12 +9,13 @@ These typically need to be modified for each LyX release
 #--------------------------------
 # Version number
 
-!define APP_VERSION_MAJOR 2
-!define APP_VERSION_MINOR 0
-!define APP_VERSION_REVISION 0
-!define APP_VERSION_BUILD 0 # Start with 1 for the installer releases of each version
+!define APP_VERSION_MAJOR @LYX_MAJOR_VERSION@
+!define APP_VERSION_MINOR @LYX_MINOR_VERSION@
+!define APP_VERSION_PATCH @LYX_PATCH_VERSION@
+!define APP_VERSION_REVISION @LYX_REVISION_VERSION@
+#!define APP_VERSION_BUILD 0 # isn't revision number enough?
 
-!define /date APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}svn %Y%m%d" # Version to display
+!define /date APP_VERSION "@LYX_MAJOR_VERSION@.@LYX_MINOR_VERSION@.@LYX_PATCH_VERSION@-@LYX_REVISION_VERSION@" # Version to display
 
 #--------------------------------
 # Installer file name
@@ -22,22 +23,23 @@ These typically need to be modified for each LyX release
 # Typical names for the release are "LyX-2.0.0-1-Installer.exe" etc.
 
 !ifndef ExeFile
-  !define /date ExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}svn-%Y%m%d-Installer.exe"
+  !define /date ExeFile "LyX-${APP_VERSION}-Installer.exe"
 !endif
 !ifndef BundleExeFile
-  !define /date BundleExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}svn-%Y%m%d-Installer-Bundle.exe"
+  !define /date BundleExeFile "LyX-${APP_VERSION}-Installer-Bundle.exe"
 !endif
 !ifndef MinimalExeFile
-  !define /date MinimalExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}svn-%Y%m%d-Installer-Minimal.exe"
+  !define /date MinimalExeFile "LyX-${APP_VERSION}-Installer-Minimal.exe"
 !endif
 
 #--------------------------------
 # File locations
 
-!define FILES_LYX "C:\LyX\lyx-20-install"
-!define FILES_DEPS "C:\LyX\lyx-20-build\msvc2010-deps\deps20"
-!define FILES_BUNDLE "C:\LyX\depsbundle"
-!define FILES_QT "C:\Qt\qt-everywhere-opensource-src-4.7.1"
+!define FILES_LYX "@CMAKE_INSTALL_PREFIX_ABSOLUTE@"
+!define FILES_DEPS "@LYX_DEPENDENCIES_DIR@/deps20"
+!define FILES_BUNDLE "@CMAKE_BINARY_DIR@/depsbundle" #TODO Where is it? Where does it comes from?
+!define FILES_QT "@QT_INCLUDE_DIR@/.."
+!define FILES_INSTALLER "@CMAKE_SOURCE_DIR@/development/Win32/packaging/installer"
 
 #--------------------------------
 # MiKTeX