diff options
-rw-r--r-- | packaging/nsis/CMakeLists.txt | 12 | ||||
-rw-r--r-- | packaging/wix/CMakeLists.txt | 50 |
2 files changed, 50 insertions, 12 deletions
diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt index 79b62557c0..d870321a4c 100644 --- a/packaging/nsis/CMakeLists.txt +++ b/packaging/nsis/CMakeLists.txt @@ -137,7 +137,16 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config.nsh" "${_config_nsh_contents}") # all-manifest.nsh. Can be created at configure time. set(_all_manifest "${CMAKE_CURRENT_BINARY_DIR}/all-manifest.nsh") set(_all_manifest_contents "# Files required for all sections. Generated by CMake.\n") -foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} +set(_all_manifest_contents "${_all_manifest_contents}!ifdef BUNDLE_DEBUG_DLLS\n") +foreach(_dll ${GLIB2_DLLS_DEBUG}) + set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") +endforeach() +set(_all_manifest_contents "${_all_manifest_contents}!else\n") +foreach(_dll ${GLIB2_DLLS_RELEASE}) + set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") +endforeach() +set(_all_manifest_contents "${_all_manifest_contents}!endif\n") +foreach(_dll ${CARES_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} @@ -233,6 +242,7 @@ macro( ADD_NSIS_PACKAGE_TARGET ) # Note that executables and DLLs *must* be built separately add_custom_target(nsis_package COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS} + $<$<CONFIG:Debug>:/DBUNDLE_DEBUG_DLLS> wireshark.nsi WORKING_DIRECTORY ${_nsis_source_dir} ) diff --git a/packaging/wix/CMakeLists.txt b/packaging/wix/CMakeLists.txt index c5bba1a17b..df8070431f 100644 --- a/packaging/wix/CMakeLists.txt +++ b/packaging/wix/CMakeLists.txt @@ -115,8 +115,23 @@ file(APPEND "${_all_manifest_wix}" " <!-- Files required for all sections. Gene file(APPEND "${_all_manifest_wix}" "<?include InputPaths.wxi ?>\n") file(APPEND "${_all_manifest_wix}" " <Fragment>\n") file(APPEND "${_all_manifest_wix}" " <DirectoryRef Id=\"INSTALLFOLDER\">\n") +file(APPEND "${_all_manifest_wix}" " <?ifdef BUNDLE_DEBUG_DLLS ?>\n") +foreach(_dll ${GLIB2_DLLS_DEBUG}) + STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) + file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") + file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") + file(APPEND "${_all_manifest_wix}" " </Component>\n") +endforeach() +file(APPEND "${_all_manifest_wix}" " <?else?>\n") +foreach(_dll ${GLIB2_DLLS_RELEASE}) + STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) + file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") + file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") + file(APPEND "${_all_manifest_wix}" " </Component>\n") +endforeach() +file(APPEND "${_all_manifest_wix}" " <?endif?>\n") SET(unique_component "") -foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} +foreach(_dll ${CARES_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} @@ -127,24 +142,35 @@ foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} #ensure uniqueness of files IF(NOT "${unique_component}" MATCHES "(^|;)${_dll}(;|$)") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) - file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") - file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") - file(APPEND "${_all_manifest_wix}" " </Component>\n") + file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") + file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") + file(APPEND "${_all_manifest_wix}" " </Component>\n") SET(unique_component ${unique_component} ${_dll}) ENDIF(NOT "${unique_component}" MATCHES "(^|;)${_dll}(;|$)") endforeach() foreach(_script "init.lua" "console.lua" "dtd_gen.lua") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_script}) - file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") - file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_script}\"/>\n") - file(APPEND "${_all_manifest_wix}" " </Component>\n") + file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") + file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_script}\"/>\n") + file(APPEND "${_all_manifest_wix}" " </Component>\n") endforeach() file(APPEND "${_all_manifest_wix}" " </DirectoryRef>\n") file(APPEND "${_all_manifest_wix}" " </Fragment>\n") file(APPEND "${_all_manifest_wix}" " <Fragment>\n") file(APPEND "${_all_manifest_wix}" " <ComponentGroup Id=\"CG.RequiredDependencies\">\n") +file(APPEND "${_all_manifest_wix}" " <?ifdef BUNDLE_DEBUG_DLLS ?>\n") +foreach(_dll ${GLIB2_DLLS_DEBUG}) + STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) + file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") +endforeach() +file(APPEND "${_all_manifest_wix}" " <?else?>\n") +foreach(_dll ${GLIB2_DLLS_RELEASE}) + STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) + file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") +endforeach() +file(APPEND "${_all_manifest_wix}" " <?endif?>\n") SET(unique_file "") -foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} +foreach(_dll ${CARES_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLL} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} @@ -155,13 +181,13 @@ foreach(_dll ${GLIB2_DLLS} ${CARES_DLL} ${GCRYPT_DLLS} #ensure uniqueness of files IF(NOT "${unique_file}" MATCHES "(^|;)${_dll}(;|$)") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) - file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") + file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") SET(unique_file ${unique_file} ${_dll}) ENDIF(NOT "${unique_file}" MATCHES "(^|;)${_dll}(;|$)") endforeach() foreach(_script "init.lua" "console.lua" "dtd_gen.lua") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_script}) - file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") + file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") endforeach() file(APPEND "${_all_manifest_wix}" " </ComponentGroup>\n") file(APPEND "${_all_manifest_wix}" " </Fragment>\n") @@ -293,7 +319,9 @@ macro( ADD_WIX_PACKAGE_TARGET ) # ${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} + COMMAND ${WIX_CANDLE_EXECUTABLE} ${WIX_CANDLE_DEFINES} + $<$<CONFIG:Debug>:-dBUNDLE_DEBUG_DLLS> + ${WIX_SOURCE_FILES} WORKING_DIRECTORY ${_wix_source_dir} COMMAND ${WIX_LIGHT_EXECUTABLE} ${WIX_LIGHT_DEFINES} ${WIX_OUT_FILES} |