############################################################################
# CMakeLists.txt file for building ROOT gui/qt5webdisplay package
############################################################################

set(libname ROOTQt5WebDisplay)

find_package(Qt5 COMPONENTS Core WebEngine WebEngineWidgets REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(${Qt5WebEngine_INCLUDE_DIRS})
include_directories(${Qt5WebEngineWidgets_INCLUDE_DIRS})

ROOT_OBJECT_LIBRARY(RootQt5WebObjs rootwebview.cpp rootwebpage.cpp rooturlschemehandler.cpp rootqt5.cpp)

ROOT_LINKER_LIBRARY(${libname} $<TARGET_OBJECTS:RootQt5WebObjs>
                    LIBRARIES Qt5::WebEngine Qt5::WebEngineWidgets
                    DEPENDENCIES Core RHTTP)

############################################################################
# CMakeLists.txt file for building ROOT gui/qt5webdisplay package
############################################################################

set(libname ROOTQt5WebDisplay)

if(POLICY CMP0071)
  cmake_policy(SET CMP0071 NEW)
endif()

find_package(Qt5 COMPONENTS Core WebEngine WebEngineWidgets REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(${Qt5WebEngine_INCLUDE_DIRS})
include_directories(${Qt5WebEngineWidgets_INCLUDE_DIRS})

ROOT_OBJECT_LIBRARY(RootQt5WebObjs rootwebview.cpp rootwebpage.cpp rooturlschemehandler.cpp rootqt5.cpp)

ROOT_LINKER_LIBRARY(${libname} $<TARGET_OBJECTS:RootQt5WebObjs>
                    LIBRARIES Qt5::WebEngine Qt5::WebEngineWidgets
                    DEPENDENCIES Core RHTTP)

Set CMake policy CMP0071 to NEW to avoid warnings
Set CMake policy CMP0071 to NEW to avoid warnings

This policy affects how source files that are ``GENERATED``
get treated in ``AUTOMOC`` and ``AUTOUIC``. The OLD behavior
is to not process generated files, while the NEW behavior is
to process them. We only have regular source files, so either
way it should work, but since the old behavior is always
deprecated at a later date, we set it to NEW.
