File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,11 @@ macro(ocv_check_flag_support lang flag varname base_options)
564
564
elseif ("_${lang} _" MATCHES "_C_" )
565
565
set (_lang C )
566
566
elseif ("_${lang} _" MATCHES "_OBJCXX_" )
567
- set (_lang OBJCXX )
567
+ if (DEFINED CMAKE_OBJCXX_COMPILER ) # CMake 3.16+ and enable_language(OBJCXX) call are required
568
+ set (_lang OBJCXX )
569
+ else ()
570
+ set (_lang CXX )
571
+ endif ()
568
572
else ()
569
573
set (_lang ${lang} )
570
574
endif ()
@@ -573,7 +577,9 @@ macro(ocv_check_flag_support lang flag varname base_options)
573
577
string (REGEX REPLACE "^(/|-)" "HAVE_${_lang} _" ${varname} "${${varname} }" )
574
578
string (REGEX REPLACE " -|-|=| |\\ .|," "_" ${varname} "${${varname} }" )
575
579
576
- ocv_check_compiler_flag ("${_lang} " "${base_options} ${flag} " ${${varname}} ${ARGN} )
580
+ if (DEFINED CMAKE_${_lang}_COMPILER )
581
+ ocv_check_compiler_flag ("${_lang} " "${base_options} ${flag} " ${${varname}} ${ARGN} )
582
+ endif ()
577
583
endmacro ()
578
584
579
585
macro (ocv_check_runtime_flag flag result )
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ ocv_create_module(${HIGHGUI_LIBRARIES})
151
151
152
152
macro (ocv_highgui_configure_target )
153
153
if (APPLE )
154
- add_apple_compiler_options (the_module )
154
+ add_apple_compiler_options (${ the_module} )
155
155
endif ()
156
156
157
157
if (MSVC )
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ ocv_create_module(${GRFMT_LIBS} ${IMGCODECS_LIBRARIES})
131
131
132
132
macro (ocv_imgcodecs_configure_target )
133
133
if (APPLE )
134
- add_apple_compiler_options (the_module )
134
+ add_apple_compiler_options (${ the_module} )
135
135
endif ()
136
136
137
137
if (MSVC )
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ ocv_create_module(${VIDEOIO_LIBRARIES})
253
253
254
254
macro (ocv_videoio_configure_target )
255
255
if (APPLE )
256
- add_apple_compiler_options (the_module )
256
+ add_apple_compiler_options (${ the_module} )
257
257
endif ()
258
258
259
259
if (MSVC )
You can’t perform that action at this time.
0 commit comments