aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-08-14 17:40:18 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-08-28 16:48:38 +0200
commit4d63dfffb661115f58cca60c80c4649ba982e01b (patch)
treedc25bf2dce3684b26dc5794f888146e0558d5f5d /sources/shiboken2/ApiExtractor
parent5e4d33d8a53ed9df402bf715855e62cbe705621f (diff)
CMake modularization: macros creation
First step of this process that only considers the idea of encapsulate the diffrent CMake processes we currently have in all our main CMakeLists.txt files. This patch simply takes some sections of the existing cmake files and move them to a macro file. Additionally, a couple of macros were written twice in shiboken and pyside, so now they are only once. Task-number: PYSIDE-1033 Change-Id: I2c63d8a2eba3d8951097ec9c9042c782fde5dd62 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/CMakeLists.txt b/sources/shiboken2/ApiExtractor/CMakeLists.txt
index c8a5fb336..c2a4c208e 100644
--- a/sources/shiboken2/ApiExtractor/CMakeLists.txt
+++ b/sources/shiboken2/ApiExtractor/CMakeLists.txt
@@ -30,6 +30,22 @@ parser/enumvalue.cpp
xmlutils.cpp
)
+find_package(Qt5XmlPatterns 5.12)
+find_package(Qt5Xml 5.12)
+find_package(LibXml2 2.6.32)
+find_package(LibXslt 1.1.19)
+
+set(HAS_LIBXSLT 0)
+if (LIBXSLT_FOUND AND LIBXML2_FOUND)
+ set(HAS_LIBXSLT 1)
+endif()
+
+if(NOT Qt5XmlPatterns_FOUND AND NOT HAS_LIBXSLT)
+ set(DISABLE_DOCSTRINGS TRUE)
+ message(WARNING
+ "Documentation will not be built due to missing dependency (no Qt5XmlPatterns found).")
+endif()
+
add_library(apiextractor STATIC ${apiextractor_SRC})
target_include_directories(apiextractor PRIVATE ${CLANG_EXTRA_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
@@ -68,6 +84,7 @@ target_compile_definitions(apiextractor PRIVATE CMAKE_CXX_COMPILER="${CMAKE_CXX_
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
if (BUILD_TESTS)
+ find_package(Qt5Test 5.12 REQUIRED)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests)
enable_testing()
add_subdirectory(tests)