From 8f539cbae46df654332742788eb7795e8b247ab2 Mon Sep 17 00:00:00 2001 From: rikky Date: Wed, 6 Jul 2011 00:09:02 +0000 Subject: [PATCH] Fix:build/cmake:Test for -snone support of saxon, to support more saxon variants git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4590 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/CMakeLists.txt | 12 +++++++++--- navit/cmake/test.xml | 3 +++ navit/cmake/test.xslt | 2 ++ navit/navit/CMakeLists.txt | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 navit/cmake/test.xml create mode 100644 navit/cmake/test.xslt diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt index db59b63..4271258 100644 --- a/navit/CMakeLists.txt +++ b/navit/CMakeLists.txt @@ -191,7 +191,7 @@ if (QT_FOUND) set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE ${QT_LIBRARIES}) if (QTDECLARATIVE_FOUND AND QT_QTXML_FOUND) - include_directories(${QTDECLARATIVE_INCLUDE_DIRS}) + include_directories(${QTDECLARATIVE_INCLUDE_DIRS}) set_with_reason(gui/qml "Qt Declarative found" TRUE ${QTDECLARATIVE_LIBRARIES}) endif() @@ -324,9 +324,15 @@ add_feature(BUILD_MAPTOOL "default" TRUE) add_feature(XSL_PROCESSING "default" TRUE) find_program(SAXON NAMES saxon saxon8 saxon-xslt saxonb-xslt) -if(NOT SAXON) +if(SAXON) + execute_process(COMMAND ${SAXON} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt + RESULT_VARIABLE SAXON_ERROR) + if (NOT SAXON_ERROR) + set (SAXON_OPTIONS -snone) + endif() +else() cfg_feature(XSL_PROCESSING "Saxon missing" FALSE) -endif() +endif(SAXON) if (NOT XSL_PROCESSING) message(WARNING "XSLT processing disabled. You have to configure navit.xml yourself, or enable XSLT processing.") diff --git a/navit/cmake/test.xml b/navit/cmake/test.xml new file mode 100644 index 0000000..23aa0bd --- /dev/null +++ b/navit/cmake/test.xml @@ -0,0 +1,3 @@ + +]> + diff --git a/navit/cmake/test.xslt b/navit/cmake/test.xslt new file mode 100644 index 0000000..dcfe1f7 --- /dev/null +++ b/navit/cmake/test.xslt @@ -0,0 +1,2 @@ + + diff --git a/navit/navit/CMakeLists.txt b/navit/navit/CMakeLists.txt index 4332c3f..ce74f98 100644 --- a/navit/navit/CMakeLists.txt +++ b/navit/navit/CMakeLists.txt @@ -108,7 +108,7 @@ macro(process_xslt SRC_XML DEST_XML XSL_OPTIONS) set (XSLT_FILE "${PROJECT_SOURCE_DIR}/navit/xslt/${tmp}.xslt") list(APPEND XSLT_FILES "${XSLT_FILE}") list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E echo Applying ${tmp}.xslt) - list(APPEND XSLT_COMMANDS COMMAND ${SAXON} -snone ${DEST_XML} ${XSLT_FILE} ${XSL_OPTIONS} > ${DEST_XML}.tmp) + list(APPEND XSLT_COMMANDS COMMAND ${SAXON} ${SAXON_OPTIONS} ${DEST_XML} ${XSLT_FILE} ${XSL_OPTIONS} > ${DEST_XML}.tmp) list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E rename ${DEST_XML}.tmp ${DEST_XML}) endforeach() endif() -- 2.7.4