Paste the COMPLETE build information from "Help->About Wireshark", "wireshark -v", or "tshark -v".
I’ve found a bug in the CMake (build file generation) process on Win64 targets, which causes the redefinition of the CYGWIN_INSTALL_PATH variable partway through the build file generation. This bug originally manifested when CMake was unable to locate the SH_EXECUTABLE file in the C:\Cygwin64 directory.The root cause is that CMake's stock FindPerl.cmake file is called containing the following directive:include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)This points to the stock copy of FindCygwin.cmake instead of the modified version (wireshark\cmake\modules\FindCygwin.cmake) included in the wireshark source that adds the C:\Cygwin64 and WIRESHARK_CYGWIN_INSTALL_PATH search paths. Thus when the FindPerl module is executed it redefines the existing CYGWIN_INSTALL_PATH with an invalid search location, unless Cygwin has been installed at C:\Cygwin. Neither C:\Cygwin64 or WIRESHARK_CYGWIN_INSTALL_PATH will be checked. (These changes were added in commit 25ec91a on 2015-11-13, and affects 2.0.0 and later versions )The easiest fix is to simply add the stock copy the FindPerl.cmake file to the wireshark\cmake\modules\ directory, which forces the correct version of the FindCygwin.cmake to be used.
Thanks for the detailed analysis Ike.
AS you said I fear the best choice is to distribute our own FindPerl.cmake so as to be compatible with the new CMake 3.9.0 and still support older CMake versions.
I forgot to mention that you need to modify line 73 of FindPerl.cmake after it is copied to the /wireshark/cmake/modules directory:Changeinclude(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)toinclude(FindPackageHandleStandardArgs.cmake)This allows the FindPackageHandleStandardArgs.cmake to originate from the CMake module directory C:/Program Files/CMake/.../Modules instead of forcing wireshark to include a copy of this file.
(In reply to Gerald Combs from comment #11)
> @Ike Out of curiosity, do you have an HKLM\Software\Cygwin\setup\rootdir
> registry key? If so, does it point to c:\Cygwin64?
Looking in RegEdit, the Cygwin rootdir key is present and currently populated with C:\Cygwin64 as expected. The version of CMake I was using was 3.9.0-rc5-win64-x64.Adding some debug code into my FindCygwin.cmake file:SET(IKE_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir])GET_FILENAME_COMPONENT(IKE_ROOT ${IKE_PATH} ABSOLUTE)MESSAGE("IKE_ROOT = ${IKE_ROOT}")I can see the correct C:\Cygwin64 path is displayed.I wonder if there is some bug in CMake-3.9.0-rc5 that affects the ability of the find_path function to properly translate "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]" into a usable file path?