aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-04-18 11:40:47 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-04-18 12:20:58 +0000
commit48625f9447caaea3fb9524169bb75dd881cdf4c9 (patch)
treed766a1ac54b7780478db8242f871585077b834f4
parent46c0a33bfaa7c8c936971540762caa59ef96af11 (diff)
Fix shiboken not to fail building when doc dependencies are missing
QtXmlPatterns is now deprecated, and until we port to some other library, the CI will not have XmlPatterns anymore. Change the build system of shiboken to skip building the documentation parts if the dependency is missing. Change-Id: I75d38502cd1efa84f7ec148622ffbf26084d0c35 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--sources/shiboken2/ApiExtractor/CMakeLists.txt9
-rw-r--r--sources/shiboken2/ApiExtractor/tests/CMakeLists.txt2
-rw-r--r--sources/shiboken2/CMakeLists.txt13
-rw-r--r--sources/shiboken2/generator/CMakeLists.txt3
4 files changed, 15 insertions, 12 deletions
diff --git a/sources/shiboken2/ApiExtractor/CMakeLists.txt b/sources/shiboken2/ApiExtractor/CMakeLists.txt
index 4c0ac7b30..bd5654303 100644
--- a/sources/shiboken2/ApiExtractor/CMakeLists.txt
+++ b/sources/shiboken2/ApiExtractor/CMakeLists.txt
@@ -2,18 +2,15 @@ project(apiextractor)
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
-find_package(LibXml2 2.6.32)
-find_package(LibXslt 1.1.19)
-option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE)
-
-set (USE_LIBXSLT 0)
+set(USE_LIBXSLT 0)
if (NOT DISABLE_DOCSTRINGS)
if (LIBXSLT_FOUND AND LIBXML2_FOUND)
add_definitions(-DHAVE_LIBXSLT)
set (USE_LIBXSLT 1)
else()
- message(WARNING "libxslt and/or libxml not found, falling back to QtXmlPatterns (QTBUG-66925)")
+ message(WARNING
+ "libxslt and/or libxml not found, falling back to QtXmlPatterns (QTBUG-66925)")
endif()
endif()
diff --git a/sources/shiboken2/ApiExtractor/tests/CMakeLists.txt b/sources/shiboken2/ApiExtractor/tests/CMakeLists.txt
index e100ef493..1429a63b1 100644
--- a/sources/shiboken2/ApiExtractor/tests/CMakeLists.txt
+++ b/sources/shiboken2/ApiExtractor/tests/CMakeLists.txt
@@ -1,8 +1,6 @@
find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Test)
-find_package(Qt5Xml)
-find_package(Qt5XmlPatterns)
set(CMAKE_AUTORCC ON)
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt
index 1e52c4297..0f39bff61 100644
--- a/sources/shiboken2/CMakeLists.txt
+++ b/sources/shiboken2/CMakeLists.txt
@@ -11,7 +11,18 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/data/")
include(helpers)
include(shiboken_helpers)
-find_package(Qt5 5.12 REQUIRED COMPONENTS Core Xml XmlPatterns)
+find_package(Qt5 5.12 REQUIRED COMPONENTS Core)
+find_package(Qt5Xml 5.12)
+find_package(Qt5XmlPatterns 5.12)
+find_package(LibXml2 2.6.32)
+find_package(LibXslt 1.1.19)
+
+option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE)
+if(NOT Qt5XmlPatterns_FOUND OR NOT Qt5Xml_FOUND)
+ set(DISABLE_DOCSTRINGS TRUE)
+ message(WARNING
+ "Documentation will not be built due to missing dependency (no Qt5XmlPatterns found).")
+endif()
option(BUILD_TESTS "Build tests." TRUE)
option(USE_PYTHON_VERSION "Use specific python version to build shiboken2." "")
diff --git a/sources/shiboken2/generator/CMakeLists.txt b/sources/shiboken2/generator/CMakeLists.txt
index 943e8d19b..890790522 100644
--- a/sources/shiboken2/generator/CMakeLists.txt
+++ b/sources/shiboken2/generator/CMakeLists.txt
@@ -1,8 +1,5 @@
project(shibokengenerator)
-find_package(Qt5Xml)
-find_package(Qt5XmlPatterns)
-
set(shiboken2_SRC
generator.cpp
shiboken2/cppgenerator.cpp