QtDialog: remove Qt4 support
This commit is contained in:
parent
21218f5c12
commit
e4d6015460
5
Help/release/dev/remove-cmake-gui-qt4.rst
Normal file
5
Help/release/dev/remove-cmake-gui-qt4.rst
Normal file
@ -0,0 +1,5 @@
|
||||
remove-cmake-gui-qt4
|
||||
--------------------
|
||||
|
||||
* :manual:`cmake-gui(1)` now requires Qt5. Support for compiling with Qt4 has
|
||||
been removed.
|
@ -3,54 +3,53 @@
|
||||
|
||||
project(QtDialog)
|
||||
CMake_OPTIONAL_COMPONENT(cmake-gui)
|
||||
find_package(Qt5Widgets QUIET)
|
||||
if (Qt5Widgets_FOUND)
|
||||
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
||||
add_definitions(${Qt5Widgets_DEFINITONS})
|
||||
macro(qt4_wrap_ui)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
||||
add_definitions(${Qt5Widgets_DEFINITONS})
|
||||
macro(qt4_wrap_ui)
|
||||
qt5_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
macro(qt4_wrap_cpp)
|
||||
endmacro()
|
||||
macro(qt4_wrap_cpp)
|
||||
qt5_wrap_cpp(${ARGN})
|
||||
endmacro()
|
||||
macro(qt4_add_resources)
|
||||
endmacro()
|
||||
macro(qt4_add_resources)
|
||||
qt5_add_resources(${ARGN})
|
||||
endmacro()
|
||||
endmacro()
|
||||
|
||||
set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
|
||||
set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
|
||||
set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
|
||||
set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
|
||||
|
||||
# Try to find the package WinExtras for the task bar progress
|
||||
if(WIN32)
|
||||
# Try to find the package WinExtras for the task bar progress
|
||||
if(WIN32)
|
||||
find_package(Qt5WinExtras QUIET)
|
||||
if (Qt5WinExtras_FOUND)
|
||||
include_directories(${Qt5WinExtras_INCLUDE_DIRS})
|
||||
add_definitions(-DQT_WINEXTRAS)
|
||||
list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Remove this when the minimum version of Qt is 4.6.
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
|
||||
# Remove this when the minimum version of Qt is 4.6.
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
|
||||
if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
|
||||
list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
|
||||
set_property(SOURCE CMakeSetup.cxx
|
||||
PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
|
||||
if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
|
||||
list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES})
|
||||
set_property(SOURCE CMakeSetup.cxx
|
||||
PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
|
||||
# FIXME: This should be part of Qt5 CMake scripts, but unfortunately
|
||||
# Qt5 support is missing there.
|
||||
if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
|
||||
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
|
||||
# FIXME: This should be part of Qt5 CMake scripts, but unfortunately
|
||||
# Qt5 support is missing there.
|
||||
if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
|
||||
macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var)
|
||||
get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
|
||||
if(EXISTS "${_qt_plugin_path}")
|
||||
@ -87,27 +86,14 @@ if (Qt5Widgets_FOUND)
|
||||
DESTINATION bin
|
||||
${COMPONENT})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TARGET Qt5::Core)
|
||||
if(TARGET Qt5::Core)
|
||||
get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION)
|
||||
get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH)
|
||||
if(APPLE)
|
||||
get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set(QT_MIN_VERSION "4.4.0")
|
||||
find_package(Qt4 REQUIRED)
|
||||
if(NOT QT4_FOUND)
|
||||
message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
set(CMake_QT_LIBRARIES ${QT_LIBRARIES})
|
||||
|
||||
endif()
|
||||
|
||||
set(SRCS
|
||||
|
Loading…
Reference in New Issue
Block a user