diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index 21e9fbcd73..4665a0a71e 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -7,6 +7,7 @@ project(${TIFF_LIBRARY}) include(CheckCSourceCompiles) include(CheckFunctionExists) include(CheckIncludeFile) +include(CheckTypeSize) # Find libm, if available diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 17f5b3b7dd..a84bbff453 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -863,6 +863,11 @@ macro(_ocv_create_module) ocv_target_link_libraries(${the_module} LINK_PRIVATE ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) endif() + if(OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS) + target_compile_definitions(${the_module} ${OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS}) + unset(OPENCV_MODULE_${the_module}_COMPILE_DEFINITIONS CACHE) + endif() + add_dependencies(opencv_modules ${the_module}) if(ENABLE_SOLUTION_FOLDERS) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index e5ca276598..1bb539e957 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -987,7 +987,14 @@ endfunction() function(ocv_target_compile_definitions target) _ocv_fix_target(target) - target_compile_definitions(${target} ${ARGN}) + if(NOT TARGET ${target}) + if(NOT DEFINED OPENCV_MODULE_${target}_LOCATION) + message(FATAL_ERROR "ocv_target_compile_definitions: invalid target: '${target}'") + endif() + set(OPENCV_MODULE_${target}_COMPILE_DEFINITIONS ${OPENCV_MODULE_${target}_COMPILE_DEFINITIONS} ${ARGN} CACHE INTERNAL "" FORCE) + else() + target_compile_definitions(${target} ${ARGN}) + endif() endfunction() diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index e407ea9a11..d0b80c3bef 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,4 +1,5 @@ set(MODULE_NAME "python_bindings_generator") +set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) ocv_add_module(${MODULE_NAME} INTERNAL) set(OPENCV_PYTHON_SIGNATURES_FILE "${CMAKE_CURRENT_BINARY_DIR}/pyopencv_signatures.json" CACHE INTERNAL "")