diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-12-02 22:15:08 +0000 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-12-03 05:02:46 +0000 |
commit | 0223249c8c74794a06ae76b29e12681ad5e3ebe4 (patch) | |
tree | 73d2888f753d77dd078fa759b4df94286ec7c822 /packaging | |
parent | 0f98c6f0dd107d12ce60bb621315eceb2e75501c (diff) | |
download | wireshark-0223249c8c74794a06ae76b29e12681ad5e3ebe4.tar.gz wireshark-0223249c8c74794a06ae76b29e12681ad5e3ebe4.tar.bz2 wireshark-0223249c8c74794a06ae76b29e12681ad5e3ebe4.zip |
CMake+PortableApps: Include the VC runtime.
Move the code that finds the Visual C++ redistributable DLLs to its
own module. Run it before we create our NSIS and PortableApps targets.
Add a PortableApps target that copies the redistributable.
Bug: 11800
Change-Id: I61aeac041386b17c8f3c1d2a8cfb7b210bf98f84
Reviewed-on: https://code.wireshark.org/review/12390
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/nsis/CMakeLists.txt | 12 | ||||
-rw-r--r-- | packaging/portableapps/CMakeLists.txt | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt index a1a005f047..13dd082c9a 100644 --- a/packaging/nsis/CMakeLists.txt +++ b/packaging/nsis/CMakeLists.txt @@ -102,18 +102,6 @@ if(BUILD_wireshark_gtk AND GTK_FOUND) set (GTK_DIR "\${STAGING_DIR}") endif() -# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will likely give us a list of DLL -# paths containing spaces. We'll assume that they're all in the same -# directory and use it to create something that's easier to pass to -# NSIS. -set(MSVCR_DLL) -list(GET CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS 0 _msvcr_dll) -if(_msvcr_dll) - get_filename_component(_msvcr_dir ${_msvcr_dll} DIRECTORY) - set(MSVCR_DLL "${_msvcr_dir}/*.*") - file(TO_NATIVE_PATH "${MSVCR_DLL}" MSVCR_DLL) -endif() - # This *should* be compatible with the way we currently do things. if(MSVC12) set(_vcredist_name "vcredist_${TARGET_MACHINE}.exe") diff --git a/packaging/portableapps/CMakeLists.txt b/packaging/portableapps/CMakeLists.txt index 38c428598d..6569eece4c 100644 --- a/packaging/portableapps/CMakeLists.txt +++ b/packaging/portableapps/CMakeLists.txt @@ -21,7 +21,6 @@ # 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) @@ -46,6 +45,7 @@ macro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) 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 @@ -53,16 +53,28 @@ macro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) 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") + if(MSVCR_DLL) + add_custom_target(portableapps_runtime + COMMAND xcopy "${MSVCR_DLL}" ${_portableapps_app_dir_native} /D /I /Y + ) + else(MSVCR_DLL) + add_custom_target(portableapps_runtime + COMMAND ${CMAKE_COMMAND} -E echo "C Runtime MUST be installed on target system." + ) + endif(MSVCR_DLL) + + add_dependencies(portableapps_runtime portableapps_app_dir) + # Build the PortableApps package. # nsis_package_prep must be built prior to this. set (_portableapps_package ${CMAKE_BINARY_DIR}/packaging/portableapps/WiresharkPortable_$(VERSION).exe) add_custom_target(portableapps_package DEPENDS - portableapps_app_dir + portableapps_runtime ${_portableapps_package} ) set_target_properties(portableapps_package PROPERTIES FOLDER "Packaging") |