Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions modules/cvv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ endif()

find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${CVV_QT_MODULES})

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Automoc doesn't work properly with opencv_world build
# Use QT<ver>_WRAP_CPP() directly instead
file(GLOB_RECURSE CVV_MOC_HEADERS
"${CMAKE_CURRENT_LIST_DIR}/src/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/src/*.h"
)
if(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP(_MOC_OUTFILES ${CVV_MOC_HEADERS})
elseif(QT_VERSION_MAJOR EQUAL 5)
QT5_WRAP_CPP(_MOC_OUTFILES ${CVV_MOC_HEADERS})
endif()

foreach(module ${CVV_QT_MODULES})
list(APPEND CVV_LIBRARIES ${Qt${QT_VERSION_MAJOR}${module}_LIBRARIES})
endforeach()

ocv_glob_module_sources()
ocv_module_include_directories()
ocv_glob_module_sources(SOURCES ${_MOC_OUTFILES})
ocv_create_module(${CVV_LIBRARIES})
ocv_add_accuracy_tests()
ocv_add_perf_tests()
Expand Down