diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-04-07 12:55:42 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-04-14 19:11:50 +0000 |
commit | 495740f801ccb4ce73f517a3a99ba8dacdba744c (patch) | |
tree | 9d432f032b7202d80575c0bfeaf3ba2944050db0 /packaging/portableapps | |
parent | 1404605513cedd34070154aa355663b8e4734bc4 (diff) |
CMake: Initial PortableApps targets.
Add portableapps_app_dir and portableapps_package targets.
Change-Id: Ifea3d952eef0e267de6364999d45807236d99102
Reviewed-on: https://code.wireshark.org/review/8025
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'packaging/portableapps')
-rw-r--r-- | packaging/portableapps/CMakeLists.txt | 116 | ||||
-rw-r--r-- | packaging/portableapps/Makefile.nmake | 13 | ||||
-rwxr-xr-x | packaging/portableapps/appinfo.tmpl | 4 | ||||
-rw-r--r-- | packaging/portableapps/xcopy-deploy-exclude.txt | 2 |
4 files changed, 123 insertions, 12 deletions
diff --git a/packaging/portableapps/CMakeLists.txt b/packaging/portableapps/CMakeLists.txt new file mode 100644 index 0000000000..39ce14ec93 --- /dev/null +++ b/packaging/portableapps/CMakeLists.txt @@ -0,0 +1,116 @@ +# CMakeLists.txt +# +# Wireshark - Network traffic analyzer +# By Gerald Combs <gerald@wireshark.org> +# Copyright 1998 Gerald Combs +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +# To do: +# - Use CPack to generate the PortableApps package. +# - Copy the C runtime DLLs if they're available. + +set(PORTABLEAPPS_NAME "${CMAKE_PROJECT_NAME}Portable") +set(PORTABLEAPPS_NAME ${PORTABLEAPPS_NAME} PARENT_SCOPE) + +set (_launcher_dir "${CMAKE_CURRENT_BINARY_DIR}/${PORTABLEAPPS_NAME}") +set (PORTABLEAPPS_LAUNCHER_STAGING_DIR ${_launcher_dir} PARENT_SCOPE) + +set(PORTABLEAPPS_DIRS + ${_launcher_dir} + ${_launcher_dir}/App + ${_launcher_dir}/App/AppInfo + ${_launcher_dir}/App/AppInfo/Launcher + ${_launcher_dir}/Data + ${_launcher_dir}/Other + ${_launcher_dir}/Other/Source + PARENT_SCOPE +) + +macro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) + # Copy our binaries, libraries, and data files to the PortableApps build directory. + set(_portableapps_app_dir "${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/${CMAKE_PROJECT_NAME}") + file(TO_NATIVE_PATH "${_portableapps_app_dir}" _portableapps_app_dir_native) + file(TO_NATIVE_PATH "${DATAFILE_DIR}" _datafile_dir_native) + file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/packaging/portableapps/xcopy-deploy-exclude.txt" _xcopy_deploy_exclude) + add_custom_target(portableapps_app_dir + # We "Deploy using XCopy," which is described at + # https://msdn.microsoft.com/en-us/library/ms235291.aspx + # We also assume that the project has been built at this point. + COMMAND ${CMAKE_COMMAND} -E remove_directory ${_portableapps_app_dir} + COMMAND ${CMAKE_COMMAND} -E make_directory ${_portableapps_app_dir} + COMMAND xcopy ${_datafile_dir_native} ${_portableapps_app_dir_native} /D /I /E /Y /exclude:${_xcopy_deploy_exclude} + # XXX Copy C runtime DLLs. + ) + set_target_properties(portableapps_app_dir PROPERTIES FOLDER "Packaging") + + #Build the PortableApps package. + set (_portableapps_package ${CMAKE_BINARY_DIR}/packaging/portableapps/WiresharkPortable_$(VERSION).exe) + add_custom_target(portableapps_package + DEPENDS + portableapps_app_dir + ${_portableapps_package} + ) + set_target_properties(portableapps_package PROPERTIES FOLDER "Packaging") + + set(PORTABLEAPPS_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}.0") + configure_file( + ${CMAKE_SOURCE_DIR}/packaging/portableapps/appinfo.tmpl + ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appinfo.ini + NEWLINE_STYLE WIN32 + ) + + foreach(_portableapps_dir ${PORTABLEAPPS_DIRS}) + add_custom_command(OUTPUT ${_portableapps_dir} + COMMAND ${CMAKE_COMMAND} -E make_directory ${_portableapps_dir} + ) + endforeach() + + set(_portableapps_launcher_ini ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/Launcher/${PORTABLEAPPS_NAME}.ini) + add_custom_command(OUTPUT ${_portableapps_launcher_ini} + DEPENDS + ${PORTABLEAPPS_DIRS} + ${CMAKE_SOURCE_DIR}/packaging/portableapps/${PORTABLEAPPS_NAME}.ini + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/packaging/portableapps/${PORTABLEAPPS_NAME}.ini ${_portableapps_launcher_ini} + ) + + set(_portableapps_launcher_exe ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/${PORTABLEAPPS_NAME}.exe) + file(TO_NATIVE_PATH "${PORTABLEAPPS_LAUNCHER_STAGING_DIR}" _portableapps_native ) + add_custom_command(OUTPUT ${_portableapps_launcher_exe} + DEPENDS + ${_portableapps_launcher_ini} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/packaging/portableapps/help.html ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/help.html + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/packaging/portableapps/help.html ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/help.html + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/image/wireshark.ico ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon.ico + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/image/wsicon16.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_16.png + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/image/wsicon32.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_32.png + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/image/wsicon128.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_128.png + COMMAND ${PORTABLEAPPS_LAUNCHER_GENERATOR_EXECUTABLE} ${_portableapps_native} + ) + + add_custom_command(OUTPUT ${_portableapps_package} + DEPENDS + ${PORTABLEAPPS_DIRS} + ${CMAKE_BINARY_DIR}/packaging/portableapps/appinfo.ini + ${_portableapps_launcher_exe} + COMMAND ${PORTABLEAPPS_INSTALLER_EXECUTABLE} ${_portableapps_native} + ) +endmacro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) + +#set(CLEAN_FILES +# ${_launcher_dir} +# ${_portableapps_package} +#) diff --git a/packaging/portableapps/Makefile.nmake b/packaging/portableapps/Makefile.nmake index efe08ea07e..6a25f928d0 100644 --- a/packaging/portableapps/Makefile.nmake +++ b/packaging/portableapps/Makefile.nmake @@ -19,11 +19,6 @@ SOURCE = $(OTHER)\Source APPINFO_INI = $(APPINFO)\appinfo.ini LAUNCHER_INI = $(LAUNCHER_DIR)\$(PROGRAM_PORTABLE).ini -WSMANIFEST = ../wireshark.manifest - -NSIS_PLUGINS = nsis-plugins -FINDPROCDLL = $(WIRESHARK_LIB_DIR)\$(NSIS_PLUGINS)\FindProcDLL.dll - COPY = xcopy MKDIR = mkdir COPY_FLAGS = /d /y @@ -31,8 +26,6 @@ COPY_FLAGS = /d /y WIN32_SETUP_OPT = --download !ENDIF -NSIS_DIR = $(TOPDIR)\packaging\nsis - # XXX This should be defined in config.nmake. !IF EXIST("$(TOPDIR)\wireshark-qt-release\wireshark.exe") QT_DIR = "$(TOPDIR)\wireshark-qt-release" @@ -47,7 +40,7 @@ NEED_QT4_DLL = USE UPX_FLAGS = -q PAPPS_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO).0 -PAPPS_PACKAGE=$(PROGRAM_PORTABLE)-$(VERSION).paf.exe +PAPPS_PACKAGE=$(PROGRAM_PORTABLE)_$(VERSION).paf.exe all: package @@ -77,8 +70,8 @@ dirs: #!ENDIF $(APPINFO_INI): dirs appinfo.tmpl $(TOPDIR)\config.nmake - sed -e 's/$$(PAPPS_VERSION)/$(PAPPS_VERSION)/g' \ - -e 's/$$(VERSION)/$(VERSION)/g' \ + sed -e 's/@PORTABLEAPPS_PACKAGE_VERSION@/$(PAPPS_VERSION)/g' \ + -e 's/@VERSION@/$(VERSION)/g' \ < appinfo.tmpl > $@ $(LAUNCHER_INI): dirs $(PROGRAM_PORTABLE).ini diff --git a/packaging/portableapps/appinfo.tmpl b/packaging/portableapps/appinfo.tmpl index ef74ac58fd..9847caadde 100755 --- a/packaging/portableapps/appinfo.tmpl +++ b/packaging/portableapps/appinfo.tmpl @@ -19,8 +19,8 @@ Freeware=true CommercialUse=true [Version] -PackageVersion=$(PAPPS_VERSION) -DisplayVersion=$(VERSION) +PackageVersion=@PORTABLEAPPS_PACKAGE_VERSION@ +DisplayVersion=@VERSION@ [Control] Icons=1 diff --git a/packaging/portableapps/xcopy-deploy-exclude.txt b/packaging/portableapps/xcopy-deploy-exclude.txt new file mode 100644 index 0000000000..034fb88ffa --- /dev/null +++ b/packaging/portableapps/xcopy-deploy-exclude.txt @@ -0,0 +1,2 @@ +.ilk +.pdb |