From fe86eea31104ae2aa14f717997af1054c57b0bde Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 31 Oct 2022 19:21:19 +0200 Subject: [PATCH] build: Avoid mixing add_definitions() with find_package() --- CMakeLists.txt | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f233b249..e9305ce7c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,22 +67,6 @@ if (NOT Qt${QT_MAJOR_VERSION}Test_FOUND) set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.") endif() -add_definitions( - -DQT_DISABLE_DEPRECATED_BEFORE=0 - - -DQT_NO_KEYWORDS - - -DQT_USE_QSTRINGBUILDER - -DQT_NO_URL_CAST_FROM_STRING - -DQT_NO_CAST_TO_ASCII - -DQT_NO_FOREACH -) - -# Prevent EGL headers from including platform headers, in particular Xlib.h. -add_definitions(-DMESA_EGL_NO_X11_HEADERS) -add_definitions(-DEGL_NO_X11) -add_definitions(-DEGL_NO_PLATFORM_SPECIFIC_TYPES) - # required frameworks by Core find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Auth @@ -446,6 +430,20 @@ if (COMPILER_UNUSED_PARAMETER_SUPPORTED) add_compile_options(-Wno-unused-parameter) endif() +add_definitions( + -DQT_DISABLE_DEPRECATED_BEFORE=0 + -DQT_NO_KEYWORDS + -DQT_USE_QSTRINGBUILDER + -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_TO_ASCII + -DQT_NO_FOREACH + + # Prevent EGL headers from including platform headers, in particular Xlib.h. + -DMESA_EGL_NO_X11_HEADERS + -DEGL_NO_X11 + -DEGL_NO_PLATFORM_SPECIFIC_TYPES +) + if (KF5DocTools_FOUND) add_subdirectory(doc) endif()