From 14032c665335c69d7c9a9944a5be5cae14263324 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 12 Feb 2018 17:30:53 +0300 Subject: [PATCH] cmake: reset __content variable if file doesn't exist Resolves CMake error after relaunch with updated source code: Cannot find source file: modules/dnn/layers/layers_common.avx512_skx.cpp --- cmake/OpenCVCompilerOptimizations.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/OpenCVCompilerOptimizations.cmake b/cmake/OpenCVCompilerOptimizations.cmake index 1ed95eac42..eca540f12b 100644 --- a/cmake/OpenCVCompilerOptimizations.cmake +++ b/cmake/OpenCVCompilerOptimizations.cmake @@ -760,6 +760,8 @@ macro(ocv_add_dispatched_file filename) set(__file "${CMAKE_CURRENT_BINARY_DIR}/${filename}.${OPT_LOWER}.cpp") if(EXISTS "${__file}") file(READ "${__file}" __content) + else() + set(__content "") endif() if(__content STREQUAL __codestr) #message(STATUS "${__file} contains up-to-date content")