Commit 62bc64d5 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

autogen: make version variables available for CMake 3.13

See: cmake/cmake#18732
Fixes: #18732
Fixes: #18733
parent 3a46ab5e
Pipeline #128967 failed with stage
......@@ -270,7 +270,24 @@ IDI_ICON1 ICON \"${_paraview_client_APPLICATION_ICON}\"\n")
set(CMAKE_AUTORCC 1)
endif ()
find_package(Qt5 REQUIRED QUIET COMPONENTS Widgets)
find_package(Qt5 REQUIRED QUIET COMPONENTS Core Widgets)
# CMake 3.13 started using Qt5's version variables to detect what version
# of Qt's tools to run for autorcc. However, they are looked up using the
# target's directory scope, but these are here in a local scope and unset
# when AutoGen gets around to asking about the variables at generate time.
# Fix for 3.13.0–3.13.3. Does not work if `paraview_client_add` is called
# from another function.
set(Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}" PARENT_SCOPE)
set(Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MINOR}" PARENT_SCOPE)
# Fix for 3.13.4+.
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
PROPERTY
Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
PROPERTY
Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MAJOR}")
set(_paraview_client_source_files
"${CMAKE_CURRENT_BINARY_DIR}/${_paraview_client_NAME}_main.cxx"
......
......@@ -700,6 +700,24 @@ function (paraview_add_plugin name)
list(APPEND _paraview_add_plugin_required_libraries
ParaView::pqCore)
endif ()
# CMake 3.13 started using Qt5's version variables to detect what version
# of Qt's tools to run for automoc, autouic, and autorcc. However, they are
# looked up using the target's directory scope, but these are here in a
# local scope and unset when AutoGen gets around to asking about the
# variables at generate time.
# Fix for 3.13.0–3.13.3. Does not work if `paraview_add_plugin` is called
# from another function.
set(Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}" PARENT_SCOPE)
set(Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MINOR}" PARENT_SCOPE)
# Fix for 3.13.4+.
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
PROPERTY
Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
PROPERTY
Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MAJOR}")
endif ()
set(_paraview_add_plugin_with_python 0)
......
Supports Markdown
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