cmake: make Cygwin optional

Cygwin is not needed if the documentation is not built (i.e. asciidoc,
docbook, xsltproc are not needed). Via Chocolatey the following packages
can be installed: git, winflexbison, strawberryperl.

Change-Id: Ib13d144321cf6d2ed5c3346a2ae271de983deada
Reviewed-on: https://code.wireshark.org/review/21316
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2017-04-24 18:14:29 +02:00
parent 46b105d513
commit 35f620c533
2 changed files with 10 additions and 7 deletions

View File

@ -55,12 +55,15 @@ if (WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
if(${CYGWIN_INSTALL_PATH} STREQUAL "CYGWIN_INSTALL_PATH-NOTFOUND")
message(FATAL_ERROR "Cygwin installation path was not detected. You can set it with WIRESHARK_CYGWIN_INSTALL_PATH environment variable.")
else()
mark_as_advanced(
CYGWIN_INSTALL_PATH
)
if(NOT CYGWIN_INSTALL_PATH)
if(WIRESHARK_CYGWIN_INSTALL_PATH)
message(FATAL_ERROR "WIRESHARK_CYGWIN_INSTALL_PATH was specified, but Cygwin was not found.")
else()
message(WARNING "Cygwin installation path was not detected. You can set it with WIRESHARK_CYGWIN_INSTALL_PATH environment variable.")
endif()
endif()
mark_as_advanced(
CYGWIN_INSTALL_PATH
)
endif ()

View File

@ -20,7 +20,7 @@ include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( SH DEFAULT_MSG SH_EXECUTABLE )
# Ensure this is Cygwin bash
if( WIN32 )
if( WIN32 AND CYGWIN_INSTALL_PATH )
execute_process( COMMAND ${SH_EXECUTABLE} --version OUTPUT_VARIABLE SH_VERSION )
string( FIND "${SH_VERSION}" "cygwin" SH_IS_CYGWIN )
if( ${SH_IS_CYGWIN} LESS 0 )