cmake: disable checks for protobuf generated files

pull/11093/head
Alexander Alekhin 7 years ago
parent d7e9201434
commit 6c8014e7d1
  1. 18
      cmake/OpenCVUtils.cmake
  2. 5
      modules/dnn/CMakeLists.txt

@ -565,6 +565,24 @@ macro(ocv_append_build_options var_prefix pkg_prefix)
endforeach()
endmacro()
function(ocv_append_source_files_cxx_compiler_options files_var)
set(__flags "${ARGN}")
ocv_check_flag_support(CXX "${__flags}" __HAVE_COMPILER_OPTIONS_VAR "")
if(${__HAVE_COMPILER_OPTIONS_VAR})
foreach(source ${${files_var}})
if("${source}" MATCHES "\\.(cpp|cc|cxx)$")
get_source_file_property(flags "${source}" COMPILE_FLAGS)
if(flags)
set(flags "${flags} ${__flags}")
else()
set(flags "${__flags}")
endif()
set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}")
endif()
endforeach()
endif()
endfunction()
# Usage is similar to CMake 'pkg_check_modules' command
# It additionally controls HAVE_${define} and ${define}_${modname}_FOUND variables
macro(ocv_check_modules define)

@ -87,6 +87,11 @@ if(WITH_INF_ENGINE AND HAVE_INF_ENGINE)
endif()
ocv_module_include_directories(${include_dirs})
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
ocv_append_source_files_cxx_compiler_options(fw_srcs "-Wno-suggest-override") # GCC
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
ocv_append_source_files_cxx_compiler_options(fw_srcs "-Wno-inconsistent-missing-override") # Clang
endif()
ocv_glob_module_sources(${sources_options} SOURCES ${fw_srcs})
ocv_create_module(${libs})
ocv_add_samples()

Loading…
Cancel
Save