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

@ -10,15 +10,7 @@ install(FILES dds.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
##################################
# EPS support depends on the gs utility; non-UNIX systems are unlikely to have
# this available in PATH
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 (BUILD_EPS_PLUGIN)
if (Qt5PrintSupport_FOUND)
add_library(kimg_eps MODULE eps.cpp)
target_link_libraries(kimg_eps Qt5::Gui Qt5::PrintSupport)
@ -30,14 +22,6 @@ 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
)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(stdint.h HAVE_STDINT_H)
configure_file(config-jp2.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-jp2.h)
@ -54,12 +38,6 @@ endif()
##################################
find_package(OpenEXR)
set_package_properties(OpenEXR PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for OpenEXR images"
)
if(OpenEXR_FOUND)
add_library(kimg_exr MODULE exr.cpp)
target_link_libraries(kimg_exr Qt5::Gui OpenEXR::IlmImf)
@ -119,13 +97,7 @@ install(FILES tga.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
##################################
find_package(WebP COMPONENTS WebP)
set_package_properties(WebP PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for WebP images"
)
if(WebP_FOUND)
if (WebP_FOUND)
add_library(kimg_webp MODULE webp.cpp)
target_link_libraries(kimg_webp Qt5::Gui WebP::WebP)