Commit 87cfcd41 authored by Granger Anthony's avatar Granger Anthony Committed by Albert Astals Cid

Allow to enable Qt5 support only with CMake >= 2.8.8

parent b44c70f0
......@@ -102,17 +102,23 @@ if(JPEG_FOUND)
set(ENABLE_LIBJPEG ${JPEG_FOUND})
endif(JPEG_FOUND)
macro_optional_find_package(Qt4)
find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Xml)
find_package(Qt5Widgets)
find_package(Qt5Test)
if (NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Xml)
find_package(Qt5Widgets)
find_package(Qt5Test)
if (NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
set(QT5_FOUND false)
else(NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
set(QT5_FOUND true)
endif(NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
set(QT5_FOUND false)
else(NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
set(QT5_FOUND true)
endif(NOT Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
message("-- CMake >= 2.8.8 is needed to enable Qt5")
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
macro_optional_find_package(Cairo ${CAIRO_VERSION})
if(CAIRO_FOUND)
set(HAVE_CAIRO ${CAIRO_FOUND})
......
......@@ -37,7 +37,6 @@ macro(QT5_ADD_QTEST exe source)
${source}
)
poppler_add_unittest(${exe} BUILD_QT5_TESTS ${${test_name}_SOURCES})
qt5_generate_moc(${${test_name}_SOURCES} ${test_name}.moc)
target_link_libraries(${exe} poppler-qt5 ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES})
if(MSVC)
target_link_libraries(${exe} poppler ${poppler_LIBS})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment