diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3e88ea5ce9a820890e1612082c2520272c68aed..73f21ccbc717c18c005cfcdd9f98f8d2530e05f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,6 +107,9 @@ target_compile_options(Vivy PRIVATE
 
 target_link_libraries(Vivy PRIVATE -fopenmp)
 
+# Prepare for Qt6
+target_compile_definitions(Vivy PRIVATE QT_DISABLE_DEPRECATED_BEFORE=0x050F00)
+
 # Some compiler specific warnings and options
 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
     target_compile_options(Vivy PRIVATE