cmake: disable checks for protobuf generated files

This commit is contained in:
Alexander Alekhin
2018-03-20 13:26:13 +03:00
parent d7e9201434
commit 6c8014e7d1
2 changed files with 23 additions and 0 deletions

View File

@@ -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)