diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-02-16 13:25:02 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-02-16 22:18:48 +0000 |
commit | 29ac5a9e61edcde7d7f517be3b9734bf29ad8dc9 (patch) | |
tree | 1038bd7fc73e4011e5905e18d877864c4a67d18b /packaging/wix | |
parent | ba1ef0ec3d15927e72d3705bed295807e5054a75 (diff) |
Don't fail in CMake on Windows if you've disabled building Wireshark.
It's possible to do a *build* on Windows without the Wireshark app being
built; however, the *installers* can't currently be built.
If we have NSIS or WiX, and Wireshark isn't being built, report a
warning, and don't have targets for building the installers.
Change-Id: I2cc9c1f6ba375dbcb6d5b7520d2fa33ad97ba9fe
Reviewed-on: https://code.wireshark.org/review/32061
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'packaging/wix')
-rw-r--r-- | packaging/wix/CMakeLists.txt | 128 |
1 files changed, 67 insertions, 61 deletions
diff --git a/packaging/wix/CMakeLists.txt b/packaging/wix/CMakeLists.txt index d1db7c2bdf..dd360e87ad 100644 --- a/packaging/wix/CMakeLists.txt +++ b/packaging/wix/CMakeLists.txt @@ -217,78 +217,84 @@ set(WIX_HEAT_FLAGS ) macro( ADD_WIX_PACKAGE_TARGET ) - set (_wix_source_dir ${CMAKE_SOURCE_DIR}/packaging/wix ) - set (_wix_binary_dir ${CMAKE_BINARY_DIR}/packaging/wix ) - - # QtDependentComponents.wxs. Created using Wireshark.exe. # - # XXX - if we're not building Wireshark, we can't build this - # manifest. On the other hand, if we're not building - # Wireshark, we have no need to include Qt in the installer, - # so it's not clear we need this manifest. + # XXX - if we're not building Wireshark, we can't build + # QtDependentComponents.wxs.. On the other hand, if we're + # not building Wireshark, we have no need to include Qt + # in the installer, so it's not clear we need that file. # # This should probably be fixed, so that people can produce # command-line-only installer packages. - if(NOT BUILD_wireshark) - message(FATAL_ERROR "The WiX installer cannot be built if the Wireshark program isn't built.") - endif() - add_custom_command(OUTPUT ${_wix_binary_dir}/QtDependentComponents.wxs - COMMAND set "PATH=${QT_BIN_PATH};%PATH%" - COMMAND ${POWERSHELL_COMMAND} "${_wix_source_dir}/windeployqt-to-wix.ps1" - -Executable $<TARGET_FILE:wireshark> - -FilePath ${_wix_binary_dir}/QtDependentComponents.wxs - ) + if(BUILD_wireshark) + set (_wix_source_dir ${CMAKE_SOURCE_DIR}/packaging/wix ) + set (_wix_binary_dir ${CMAKE_BINARY_DIR}/packaging/wix ) - # SNMPMibs.wxs. Collects all MIBs in "output" snmp/mibs directory. Generated with heat.exe - add_custom_command(OUTPUT ${_wix_binary_dir}/SNMPMibs.wxs - COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/snmp/mibs - ${WIX_HEAT_FLAGS} -cg CG.Plugins.SNMP -dr dirSnmpMibs -var var.SnmpMibDir - -out ${_wix_binary_dir}/SNMPMibs.wxs - ) + # QtDependentComponents.wxs. Created using Wireshark.exe. + add_custom_command(OUTPUT ${_wix_binary_dir}/QtDependentComponents.wxs + COMMAND set "PATH=${QT_BIN_PATH};%PATH%" + COMMAND ${POWERSHELL_COMMAND} "${_wix_source_dir}/windeployqt-to-wix.ps1" + -Executable $<TARGET_FILE:wireshark> + -FilePath ${_wix_binary_dir}/QtDependentComponents.wxs + ) - # RadiusDict.wxs. Collects all Radius dictionary files in "output" radius directory. Generated with heat.exe - add_custom_command(OUTPUT ${_wix_binary_dir}/RadiusDict.wxs - COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/radius - ${WIX_HEAT_FLAGS} -cg CG.RadiusDict -dr dirRadius -var var.RadiusDictDir - -out ${_wix_binary_dir}/RadiusDict.wxs - ) + # SNMPMibs.wxs. Collects all MIBs in "output" snmp/mibs + # directory. Generated with heat.exe + add_custom_command(OUTPUT ${_wix_binary_dir}/SNMPMibs.wxs + COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/snmp/mibs + ${WIX_HEAT_FLAGS} -cg CG.Plugins.SNMP -dr dirSnmpMibs -var var.SnmpMibDir + -out ${_wix_binary_dir}/SNMPMibs.wxs + ) - # Diameter.wxs. Collects all Diameter XML dictionary files in "output" diameter directory. Generated with heat.exe - add_custom_command(OUTPUT ${_wix_binary_dir}/Diameter.wxs - COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/diameter - ${WIX_HEAT_FLAGS} -cg CG.Diameter -dr dirDiameter -var var.DiameterDir - -out ${_wix_binary_dir}/Diameter.wxs - ) + # RadiusDict.wxs. Collects all Radius dictionary files in + # "output" radius directory. Generated with heat.exe + add_custom_command(OUTPUT ${_wix_binary_dir}/RadiusDict.wxs + COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/radius + ${WIX_HEAT_FLAGS} -cg CG.RadiusDict -dr dirRadius -var var.RadiusDictDir + -out ${_wix_binary_dir}/RadiusDict.wxs + ) - # QtTranslation.wxs. Collects all Qt translation files in "output" translations directory. Generated with heat.exe - add_custom_command(OUTPUT ${_wix_binary_dir}/QtTranslation.wxs - COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/translations - ${WIX_HEAT_FLAGS} -cg CG.QtTranslations -dr dirTranslations -var var.QtTranslationDir - -out ${_wix_binary_dir}/QtTranslation.wxs - ) + # Diameter.wxs. Collects all Diameter XML dictionary files + # in "output" diameter directory. Generated with heat.exe + add_custom_command(OUTPUT ${_wix_binary_dir}/Diameter.wxs + COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/diameter + ${WIX_HEAT_FLAGS} -cg CG.Diameter -dr dirDiameter -var var.DiameterDir + -out ${_wix_binary_dir}/Diameter.wxs + ) - # Build WiX package dependencies. We build the package in two stages - # so that wix_package below doesn't trigger any dependencies that - # might clobber any signed executables. - add_custom_target(wix_package_prep - DEPENDS - ${WIX_FILES} - copy_data_files - user_guide_chm - faq_html - ) - set_target_properties(wix_package_prep PROPERTIES FOLDER "Packaging") + # QtTranslation.wxs. Collects all Qt translation files in + # "output" translations directory. Generated with heat.exe + add_custom_command(OUTPUT ${_wix_binary_dir}/QtTranslation.wxs + COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/translations + ${WIX_HEAT_FLAGS} -cg CG.QtTranslations -dr dirTranslations -var var.QtTranslationDir + -out ${_wix_binary_dir}/QtTranslation.wxs + ) - # Dump the installer into ${CMAKE_CURRENT_SOURCE_DIR}/packaging/wix - # Note that executables and DLLs *must* be built separately - add_custom_target(wix_package - COMMAND ${WIX_CANDLE_EXECUTABLE} ${WIX_CANDLE_DEFINES} ${WIX_SOURCE_FILES} - WORKING_DIRECTORY ${_wix_source_dir} + # Build WiX package dependencies. We build the package in + # two stages so that wix_package below doesn't trigger any + # dependencies that might clobber any signed executables. + add_custom_target(wix_package_prep + DEPENDS + ${WIX_FILES} + copy_data_files + user_guide_chm + faq_html + ) + set_target_properties(wix_package_prep PROPERTIES FOLDER "Packaging") - COMMAND ${WIX_LIGHT_EXECUTABLE} ${WIX_LIGHT_DEFINES} ${WIX_OUT_FILES} - WORKING_DIRECTORY ${_wix_binary_dir} - ) - set_target_properties(wix_package PROPERTIES FOLDER "Packaging") + # Dump the installer into + # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/wix + # Note that executables and DLLs *must* be built separately + add_custom_target(wix_package + COMMAND ${WIX_CANDLE_EXECUTABLE} ${WIX_CANDLE_DEFINES} ${WIX_SOURCE_FILES} + WORKING_DIRECTORY ${_wix_source_dir} + + COMMAND ${WIX_LIGHT_EXECUTABLE} ${WIX_LIGHT_DEFINES} ${WIX_OUT_FILES} + WORKING_DIRECTORY ${_wix_binary_dir} + ) + set_target_properties(wix_package PROPERTIES FOLDER "Packaging") + else() + message(WARNING "The WiX installer cannot be built if the Wireshark program isn't built.") + endif() endmacro( ADD_WIX_PACKAGE_TARGET ) set(CLEAN_FILES |