forked from osmocom/wireshark
On Windows find the standard html viewer by using bigger and bigger
hammers only to realize that this really needs to be done at runtime. Commit it anyway. svn path=/trunk/; revision=53226
This commit is contained in:
parent
b6512582ab
commit
086e73cf7d
|
@ -6,17 +6,15 @@
|
|||
# HTML_VIEWER_EXECUTABLE - the full path to perl
|
||||
# HTML_VIEWER_FOUND - If false, don't attempt to use perl.
|
||||
|
||||
INCLUDE(FindCygwin)
|
||||
include( FindCygwin )
|
||||
|
||||
FIND_PROGRAM(HTML_VIEWER_EXECUTABLE
|
||||
find_program( HTML_VIEWER_EXECUTABLE
|
||||
NAMES
|
||||
xdg-open
|
||||
mozilla
|
||||
htmlview
|
||||
open
|
||||
$ENV{HTML_VIEWER}
|
||||
[HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command]
|
||||
[HKEY_CLASSES_ROOT\\http\\shell\\open\\command]
|
||||
PATHS
|
||||
${CYGWIN_INSTALL_PATH}/bin
|
||||
/bin
|
||||
|
@ -25,11 +23,26 @@ FIND_PROGRAM(HTML_VIEWER_EXECUTABLE
|
|||
/sbin
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HtmlViewer DEFAULT_MSG HTML_VIEWER_EXECUTABLE)
|
||||
if( NOT HTML_VIEWER_EXECUTABLE AND WIN32 )
|
||||
foreach( _KEY
|
||||
[HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command]
|
||||
[HKEY_CLASSES_ROOT\\http\\shell\\open\\command]
|
||||
)
|
||||
get_filename_component( _NAME_WE ${_KEY} NAME_WE )
|
||||
get_filename_component( _PATH ${_KEY} PATH )
|
||||
string(REGEX REPLACE "\"" "" _NAME_WE ${_NAME_WE})
|
||||
string(REGEX REPLACE "\"" "" _PATH ${_PATH})
|
||||
find_program( HTML_VIEWER_EXECUTABLE "${_PATH}/${_NAME_WE}" NO_DEFAULT_PATH )
|
||||
if( HTML_VIEWER_EXECUTABLE )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
include( FindPackageHandleStandardArgs )
|
||||
find_package_handle_standard_args( HtmlViewer DEFAULT_MSG HTML_VIEWER_EXECUTABLE )
|
||||
|
||||
# For compat with configure
|
||||
SET(HTML_VIEWER ${HTML_VIEWER_EXECUTABLE})
|
||||
set( HTML_VIEWER ${HTML_VIEWER_EXECUTABLE} )
|
||||
|
||||
|
||||
MARK_AS_ADVANCED(HTML_VIEWER_EXECUTABLE)
|
||||
mark_as_advanced( HTML_VIEWER_EXECUTABLE )
|
||||
|
|
Loading…
Reference in New Issue