diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 3c45d774cc..c2fda8fad6 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -1145,7 +1145,7 @@ function(ocv_add_perf_tests) source_group("Src" FILES "${${the_target}_pch}") ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch}) - ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}") + ocv_target_include_modules(${the_target} ${perf_deps}) ocv_target_link_libraries(${the_target} LINK_PRIVATE ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS} ${OPENCV_PERF_${the_module}_DEPS}) add_dependencies(opencv_perf_tests ${the_target}) @@ -1227,7 +1227,7 @@ function(ocv_add_accuracy_tests) source_group("Src" FILES "${${the_target}_pch}") ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) - ocv_target_include_modules(${the_target} ${test_deps} "${test_path}") + ocv_target_include_modules(${the_target} ${test_deps}) if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/test") ocv_target_include_directories(${the_target} "${CMAKE_CURRENT_BINARY_DIR}/test") endif() diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake index f9b1b48b65..59bc826ed0 100644 --- a/cmake/OpenCVPCHSupport.cmake +++ b/cmake/OpenCVPCHSupport.cmake @@ -261,6 +261,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input) ) _PCH_GET_COMPILE_FLAGS(_compile_FLAGS) + list(APPEND _compile_FLAGS "${_PCH_include_prefix}\"${_path}\"") get_target_property(type ${_targetName} TYPE) if(type STREQUAL "SHARED_LIBRARY")