aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-01-08 16:55:26 -0800
committerGerald Combs <gerald@wireshark.org>2015-01-09 01:11:29 +0000
commit4bc8d0f9a8414c452e1331e8e3e3803c3087feb5 (patch)
tree10d3dffba33fe985067712599885d56a11bf85dd /cmake
parent67b15939219499248432e50a73f76fed5fb03c8c (diff)
CMake: Try to fix the xsltproc path.
Try to make the xsltproc path compatible with Cygwin. This is a blind attempt to fix the Windows 8 buildbot. It works fine locally. Change-Id: Ib9d55dd07c6b17cfddf313716227d347109d2103 Reviewed-on: https://code.wireshark.org/review/6438 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindXSLTPROC.cmake44
1 files changed, 27 insertions, 17 deletions
diff --git a/cmake/modules/FindXSLTPROC.cmake b/cmake/modules/FindXSLTPROC.cmake
index 8d240704d6..f8ee12ff83 100644
--- a/cmake/modules/FindXSLTPROC.cmake
+++ b/cmake/modules/FindXSLTPROC.cmake
@@ -34,20 +34,30 @@ set (_common_xsltproc_args
--stringparam html.stylesheet ws.css
)
-#set (WSUG_XSLTPROC_ARGS
-# --stringparam admon.graphics.path wsug_graphics/
-#
-#WSDG_XSLTPROC_ARGS = \
-# --stringparam admon.graphics.path wsdg_graphics/
-#
-#SINGLE_XSLTPROC_ARGS = \
-# --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
-#
-#CHUNKED_XSLTPROC_ARGS = \
-# --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
-#
-#HTMLHELP_XSLTPROC_ARGS = \
-#
+if (WIN32 AND NOT "${CYGWIN_INSTALL_PATH}" STREQUAL "" AND ${XSLTPROC_EXECUTABLE} MATCHES "${CYGWIN_INSTALL_PATH}")
+ FIND_PROGRAM(CYGPATH_EXECUTABLE
+ NAMES cygpath
+ PATHS ${CYGWIN_INSTALL_PATH}/bin
+ )
+ # XXX Duplicate of TO_A2X_COMPATIBLE_PATH
+ MACRO( TO_XSLTPROC_COMPATIBLE_PATH _cmake_path _result )
+ execute_process(
+ COMMAND ${CYGPATH_EXECUTABLE} -u ${_cmake_path}
+ OUTPUT_VARIABLE _cygwin_path
+ )
+ # cygpath adds a linefeed.
+ string(STRIP "${_cygwin_path}" _cygwin_path)
+
+ set( ${_result} ${_cygwin_path} )
+ ENDMACRO()
+
+ TO_XSLTPROC_COMPATIBLE_PATH( ${CMAKE_CURRENT_SOURCE_DIR} _xsltproc_current_source_dir )
+ TO_XSLTPROC_COMPATIBLE_PATH( ${CMAKE_CURRENT_BINARY_DIR} _xsltproc_current_binary_dir )
+
+ set ( _xsltproc_path "${_xsltproc_current_source_dir}:${_xsltproc_current_binary_dir}:${_xsltproc_current_binary_dir}/wsluarm_src")
+else()
+ set ( _xsltproc_path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src")
+endif()
# Translate XML to HTML
#XML2HTML(
@@ -103,7 +113,7 @@ MACRO(XML2HTML _guide _mode _xmlsources _gfxsources)
COMMAND cmake
-E copy ${CMAKE_CURRENT_SOURCE_DIR}/ws.css ${_outdir}
COMMAND ${XSLTPROC_EXECUTABLE}
- --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src"
+ --path "${_xsltproc_path}"
--stringparam base.dir ${_basedir}/
${_common_xsltproc_args}
--stringparam admon.graphics.path ${_gfxdir}/
@@ -136,7 +146,7 @@ MACRO(XML2PDF _output _sources _stylesheet _paper)
OUTPUT
${_output}
COMMAND ${XSLTPROC_EXECUTABLE}
- --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src"
+ --path "${_xsltproc_path}"
--stringparam paper.type ${_paper}
--stringparam img.src.path ${CMAKE_CURRENT_SOURCE_DIR}/
--stringparam use.id.as.filename 1
@@ -182,7 +192,7 @@ MACRO(XML2HHP _guide _docbooksource)
< ${_docbooksource}
> ${_docbook_plain_title}
COMMAND ${XSLTPROC_EXECUTABLE}
- --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src"
+ --path "${_xsltproc_path}"
--stringparam base.dir ${_basedir}/
--stringparam htmlhelp.chm ${_output_chm}
--stringparam htmlhelp.hhp ${_output_hhp}