Only perform tests for plugins that are built

This both excludes the autotests and tests subdirs if the user sets
BUILD_TESTING off, and makes sure we do not run tests for formats that
were not built due to dependencies not being found.

REVIEW: 115504
This commit is contained in:
Alex Merry
2014-02-05 17:38:51 +00:00
parent 4fbbc75429
commit 6272954cc5
3 changed files with 71 additions and 49 deletions

View File

@ -16,8 +16,44 @@ include(CheckIncludeFiles)
set(REQUIRED_QT_VERSION 5.2.0)
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
# EPS support depends on the gs utility; non-UNIX systems are unlikely to have
# this available in PATH
set(BUILD_EPS_PLUGIN FALSE)
if (UNIX)
find_package(Qt5PrintSupport 5.2.0 NO_MODULE)
set_package_properties(Qt5PrintSupport PROPERTIES
PURPOSE "Required for the QImage plugin for EPS images"
TYPE OPTIONAL
)
if (Qt5PrintSupport_FOUND)
set(BUILD_EPS_PLUGIN TRUE)
endif()
endif()
find_package(Jasper)
set_package_properties(Jasper PROPERTIES
DESCRIPTION "A library for handling JPEG-2000 images"
PURPOSE "Required for the QImage plugin for JPEG-2000 images"
URL "http://www.ece.uvic.ca/~mdadams/jasper"
TYPE OPTIONAL
)
find_package(OpenEXR)
set_package_properties(OpenEXR PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for OpenEXR images"
)
find_package(WebP COMPONENTS WebP)
set_package_properties(WebP PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for WebP images"
)
add_subdirectory(src)
add_subdirectory(autotests)
add_subdirectory(tests)
if (BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)