Make Qt5Designer plugin dep optional, use Qt5UiPlugin with >=5.5

parent 381387f8
......@@ -25,7 +25,6 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED
COMPONENTS
Core
Network
Designer
PrintSupport
Script
ScriptTools
......@@ -37,6 +36,21 @@ if (NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, unit tests will not be built.")
endif()
find_package(Qt5Designer ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Designer PROPERTIES TYPE OPTIONAL
PURPOSE "Required to build Qt Designer plugins"
)
if(NOT Qt5Designer_VERSION_STRING VERSION_LESS 5.5.0)
find_package(Qt5UiPlugin ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5UiPlugin PROPERTIES TYPE OPTIONAL
PURPOSE "Required to build Qt Designer plugins"
)
if (Qt5UiPlugin_FOUND)
# for some reason, Qt5UiPlugin does not set its _INCLUDE_DIRS variable. Fill it manually
get_target_property(Qt5UiPlugin_INCLUDE_DIRS Qt5::UiPlugin INTERFACE_INCLUDE_DIRECTORIES)
endif()
endif()
set(REQUIRED_KF5_VERSION "5.7.0")
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED
......
if (NOT Qt5Designer_FOUND)
return()
endif()
set( oktetadesignerplugin_SRCS
bytearraycolumnviewdesignerfactory.cpp
bytearrayrowviewdesignerfactory.cpp
......@@ -12,7 +16,11 @@ target_link_libraries( oktetadesignerplugin
OktetaGui
OktetaCore
Qt5::Widgets
Qt5::Designer
)
target_include_directories( oktetadesignerplugin
PRIVATE
${Qt5UiPlugin_INCLUDE_DIRS}
${Qt5Designer_INCLUDE_DIRS}
)
install( TARGETS oktetadesignerplugin DESTINATION ${QT_PLUGIN_INSTALL_DIR}/designer )
......
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