From 077006a9ea18305a183e2cf809e3b88e5f7f3619 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 18 Apr 2019 14:04:42 +0200 Subject: Modernize and clean up some of the shiboken build system files Use target_* commands instead of subdirectory based commands for adding link options, compile definitions, include directories, etc. Remove some non-used compile definitions. Move around some of the find_package() and option() calls. Simplify some of the package dependent logic. Replace the qt include and linking variables with CMake targets. Change-Id: I815595344e63a32dce3dc78652359beede3ff593 Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer --- sources/shiboken2/CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sources/shiboken2/CMakeLists.txt') diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt index 0f39bff61..12429c657 100644 --- a/sources/shiboken2/CMakeLists.txt +++ b/sources/shiboken2/CMakeLists.txt @@ -11,22 +11,25 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/data/") include(helpers) include(shiboken_helpers) +option(BUILD_TESTS "Build tests." TRUE) +option(USE_PYTHON_VERSION "Use specific python version to build shiboken2." "") +option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE) + 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) +if(BUILD_TESTS) + find_package(Qt5Test 5.12 REQUIRED) +endif() -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." "") - # Don't display "up-to-date / install" messages when installing, to reduce visual clutter. if (QUIET_BUILD) set(CMAKE_INSTALL_MESSAGE NEVER) -- cgit v1.2.3