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