From 3b4b92487aed962d76543b21f8f1d999a16ad9a0 Mon Sep 17 00:00:00 2001 From: Yu SuiXian <47711102+GengGode@users.noreply.github.com> Date: Mon, 29 Jan 2024 00:54:18 +0800 Subject: [PATCH] Fix link error caused by lack of moc in the cvv module during opencv_world build --- modules/cvv/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/cvv/CMakeLists.txt b/modules/cvv/CMakeLists.txt index 645e7b39443..2c4ce628baf 100644 --- a/modules/cvv/CMakeLists.txt +++ b/modules/cvv/CMakeLists.txt @@ -15,8 +15,14 @@ endif() find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${CVV_QT_MODULES}) -set(CMAKE_AUTOMOC ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) +if(BUILD_opencv_world) + set(CMAKE_AUTOMOC ON PARENT_SCOPE) + set(CMAKE_INCLUDE_CURRENT_DIR ON PARENT_SCOPE) +else() + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + foreach(module ${CVV_QT_MODULES}) list(APPEND CVV_LIBRARIES ${Qt${QT_VERSION_MAJOR}${module}_LIBRARIES}) endforeach()