File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -863,6 +863,11 @@ macro(_ocv_create_module)
863
863
ocv_target_link_libraries (${the_module} LINK_PRIVATE ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY} )
864
864
endif ()
865
865
866
+ if (OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS )
867
+ target_compile_definitions (${the_module} ${OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS} )
868
+ unset (OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS CACHE )
869
+ endif ()
870
+
866
871
add_dependencies (opencv_modules ${the_module} )
867
872
868
873
if (ENABLE_SOLUTION_FOLDERS )
Original file line number Diff line number Diff line change @@ -987,7 +987,14 @@ endfunction()
987
987
988
988
function (ocv_target_compile_definitions target )
989
989
_ocv_fix_target (target )
990
- target_compile_definitions (${target} ${ARGN} )
990
+ if (NOT TARGET ${target} )
991
+ if (NOT DEFINED OPENCV_MODULE_${target}_LOCATION )
992
+ message (FATAL_ERROR "ocv_target_compile_definitions: invalid target: '${target} '" )
993
+ endif ()
994
+ set (OPENCV_MODULE_${target}_COMPILE_DEFINITIONS ${OPENCV_MODULE_${target}_COMPILE_DEFINITIONS} ${ARGN} CACHE INTERNAL "" FORCE )
995
+ else ()
996
+ target_compile_definitions (${target} ${ARGN} )
997
+ endif ()
991
998
endfunction ()
992
999
993
1000
You can’t perform that action at this time.
0 commit comments