Skip to content

Commit a5c04ba

Browse files
committed
Merge pull request opencv#10326 from alalek:cmake_fixes
2 parents 70e1b4d + 361bb11 commit a5c04ba

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

3rdparty/libtiff/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ project(${TIFF_LIBRARY})
77
include(CheckCSourceCompiles)
88
include(CheckFunctionExists)
99
include(CheckIncludeFile)
10+
include(CheckTypeSize)
1011

1112

1213
# Find libm, if available

cmake/OpenCVModule.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,11 @@ macro(_ocv_create_module)
863863
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
864864
endif()
865865

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+
866871
add_dependencies(opencv_modules ${the_module})
867872

868873
if(ENABLE_SOLUTION_FOLDERS)

cmake/OpenCVUtils.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,14 @@ endfunction()
987987

988988
function(ocv_target_compile_definitions target)
989989
_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()
991998
endfunction()
992999

9931000

modules/python/bindings/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set(MODULE_NAME "python_bindings_generator")
2+
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
23
ocv_add_module(${MODULE_NAME} INTERNAL)
34

45
set(OPENCV_PYTHON_SIGNATURES_FILE "${CMAKE_CURRENT_BINARY_DIR}/pyopencv_signatures.json" CACHE INTERNAL "")

0 commit comments

Comments
 (0)