aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/CMakeLists.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-18 12:41:14 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-25 11:53:15 +0000
commit21077bec48f2ca16ec0fed25e0c0af62317606d9 (patch)
tree8f3e8e6c636ce96c7385745a8b15959c01de426e /sources/shiboken2/ApiExtractor/CMakeLists.txt
parente336872828de86146059de0f62ed06afaaf64d8d (diff)
shiboken2: Enable documentation generation with libxml2/libxslt
As QtXmlPatterns is deprecated in Qt 5.14, the documentation build needs to be changed to work with libxml2/libxslt exclusively. Split the XML functionality into separate files for libxslt and Qt and provide an interface for XPATH queries and XSLT transformations in xmlutils.h. Adapt testmodifydocumentation to work on temporary files as libxslt cannot handle Qt resources. Change-Id: I923f5b2e7c1d2511f15788e4b80c7721daeb2bc3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/CMakeLists.txt')
-rw-r--r--sources/shiboken2/ApiExtractor/CMakeLists.txt26
1 files changed, 17 insertions, 9 deletions
diff --git a/sources/shiboken2/ApiExtractor/CMakeLists.txt b/sources/shiboken2/ApiExtractor/CMakeLists.txt
index 147fda377..760cc6985 100644
--- a/sources/shiboken2/ApiExtractor/CMakeLists.txt
+++ b/sources/shiboken2/ApiExtractor/CMakeLists.txt
@@ -26,6 +26,7 @@ clangparser/clangutils.cpp
# Old parser
parser/codemodel.cpp
parser/enumvalue.cpp
+xmlutils.cpp
)
add_library(apiextractor STATIC ${apiextractor_SRC})
@@ -37,19 +38,26 @@ target_include_directories(apiextractor PRIVATE ${CLANG_EXTRA_INCLUDES}
target_link_libraries(apiextractor PUBLIC Qt5::Core)
target_link_libraries(apiextractor PRIVATE ${CLANG_EXTRA_LIBRARIES})
+if (HAS_LIBXSLT)
+ target_compile_definitions(apiextractor PUBLIC HAVE_LIBXSLT)
+ target_sources(apiextractor PRIVATE xmlutils_libxslt.cpp)
+ target_include_directories(apiextractor
+ PRIVATE ${LIBXSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
+ target_link_libraries(apiextractor
+ PRIVATE ${LIBXSLT_LIBRARIES} ${LIBXML2_LIBRARIES})
+endif()
+
+if (Qt5XmlPatterns_FOUND)
+ target_compile_definitions(apiextractor PUBLIC HAVE_QTXMLPATTERNS)
+ target_sources(apiextractor PRIVATE xmlutils_qt.cpp)
+ target_link_libraries(apiextractor PUBLIC Qt5::Xml Qt5::XmlPatterns)
+endif()
+
if (NOT DISABLE_DOCSTRINGS)
target_sources(apiextractor PRIVATE docparser.cpp
doxygenparser.cpp
qtdocparser.cpp)
- target_link_libraries(apiextractor PUBLIC Qt5::Xml Qt5::XmlPatterns)
-
- if (LIBXSLT_FOUND AND LIBXML2_FOUND)
- target_compile_definitions(apiextractor PUBLIC HAVE_LIBXSLT)
- target_include_directories(apiextractor
- PRIVATE ${LIBXSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
- target_link_libraries(apiextractor
- PRIVATE ${LIBXSLT_LIBRARIES} ${LIBXML2_LIBRARIES})
- else()
+ if (NOT HAS_LIBXSLT)
message(WARNING
"libxslt and/or libxml not found, falling back to QtXmlPatterns (QTBUG-66925)")
endif()