diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 0d3d33a4f5..93b6123eba 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -698,6 +698,9 @@ endmacro() # setup include path for OpenCV headers for specified module # ocv_module_include_directories() macro(ocv_module_include_directories) + if(ENABLE_PRECOMPILED_HEADERS OR OPENCV_INCLUDE_DIR_APPEND_MODULE_SRC) + ocv_target_include_directories(${the_module} "${OPENCV_MODULE_${the_module}_LOCATION}/src") + endif() ocv_target_include_directories(${the_module} "${OPENCV_MODULE_${the_module}_LOCATION}/include" "${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers