Skip to content

Commit

Permalink
Update deprecation macros for Qt 6.5
Browse files Browse the repository at this point in the history
QT_DISABLE_DEPRECATED_BEFORE became deprecated
  • Loading branch information
hasselmm committed Oct 7, 2024
1 parent e8e2894 commit 7ee2508
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ if (NOT CMAKE_CXX_COMPILER_LAUNCHER)
endif()

set(QNC_COMPILE_DEFINITIONS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00
-DQT_NO_CAST_FROM_ASCII=1
-DQT_NO_URL_CAST_FROM_STRING=1)

Expand All @@ -43,11 +42,24 @@ find_package(QT NAMES Qt6 Qt5 COMPONENTS Core)
if (QT_VERSION_MAJOR EQUAL 6)
find_package(Qt6 REQUIRED COMPONENTS Network Test)
find_package(Qt6 QUIET COMPONENTS Zlib)

if (QT_VERSION VERSION_GREATER_EQUAL 6.5)
list(APPEND QNC_COMPILE_DEFINITIONS
-DQT_DISABLE_DEPRECATED_UP_TO=0x060500)
else()
list(APPEND QNC_COMPILE_DEFINITIONS
-DQT_DISABLE_DEPRECATED_BEFORE=0x060500)
endif()

set(Qt_DIR ${QT6_INSTALL_PREFIX})
set(Qt_VERSION ${Qt6_VERSION})
elseif (QT_VERSION_MAJOR EQUAL 5)
find_package(Qt5 5.15 REQUIRED COMPONENTS Network Test)
find_package(Qt5 QUIET COMPONENTS Zlib)

list(APPEND QNC_COMPILE_DEFINITIONS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)

set(Qt_VERSION ${Qt5_VERSION})
set(Qt_DIR ${Qt5_DIR})
else()
Expand Down

0 comments on commit 7ee2508

Please sign in to comment.