File tree Expand file tree Collapse file tree 9 files changed +41
-15
lines changed Expand file tree Collapse file tree 9 files changed +41
-15
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ if(POLICY CMP0022)
76
76
cmake_policy (SET CMP0022 OLD )
77
77
endif ()
78
78
79
+ if (POLICY CMP0023 )
80
+ cmake_policy (SET CMP0023 NEW )
81
+ endif ()
82
+
79
83
if (POLICY CMP0026 )
80
84
# silence cmake 3.0+ warnings about reading LOCATION attribute
81
85
cmake_policy (SET CMP0026 OLD )
Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ foreach(mod ${OPENCV_MODULES_BUILD})
33
33
list (APPEND OPENCV_ABI_SKIP_HEADERS "${h} " )
34
34
endforeach ()
35
35
# libraries
36
- set (lib_name "" )
37
- get_target_property (lib_name opencv_${mod} LOCATION )
38
- get_filename_component (lib_name "${lib_name} " NAME )
39
- list (APPEND OPENCV_ABI_SKIP_LIBRARIES "${lib_name} " )
36
+ if (TARGET opencv_${mod} ) # opencv_world
37
+ set (lib_name "" )
38
+ get_target_property (lib_name opencv_${mod} LOCATION )
39
+ get_filename_component (lib_name "${lib_name} " NAME )
40
+ list (APPEND OPENCV_ABI_SKIP_LIBRARIES "${lib_name} " )
41
+ endif ()
40
42
endif ()
41
43
endforeach ()
42
44
string (REPLACE ";" "\n " OPENCV_ABI_SKIP_HEADERS "${OPENCV_ABI_SKIP_HEADERS} " )
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ macro(ocv_add_module _name)
182
182
# add self to the world dependencies
183
183
if ((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD
184
184
AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS"
185
- AND NOT OPENCV_PROCESSING_EXTRA_MODULES
185
+ AND ( NOT OPENCV_PROCESSING_EXTRA_MODULES OR NOT OPENCV_WORLD_EXCLUDE_EXTRA_MODULES )
186
186
AND (NOT BUILD_SHARED_LIBS OR NOT "x${OPENCV_MODULE_TYPE} " STREQUAL "xSTATIC" ))
187
187
OR OPENCV_MODULE_IS_PART_OF_WORLD
188
188
)
@@ -724,8 +724,10 @@ endmacro()
724
724
# ocv_create_module(<extra link dependencies>)
725
725
# ocv_create_module()
726
726
macro (ocv_create_module )
727
- ocv_debug_message ("ocv_create_module(" ${ARGN} ")" )
728
- set (OPENCV_MODULE_${the_module}_LINK_DEPS "${OPENCV_MODULE_${the_module} _LINK_DEPS};${ARGN} " CACHE INTERNAL "" )
727
+ ocv_debug_message ("${the_module} : ocv_create_module(" ${ARGN} ")" )
728
+ if (NOT " ${ARGN} " STREQUAL " " )
729
+ set (OPENCV_MODULE_${the_module}_LINK_DEPS "${OPENCV_MODULE_${the_module} _LINK_DEPS};${ARGN} " CACHE INTERNAL "" )
730
+ endif ()
729
731
if (${BUILD_opencv_world} AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD )
730
732
# nothing
731
733
set (the_module_target opencv_world )
Original file line number Diff line number Diff line change @@ -303,9 +303,11 @@ ENDMACRO(ADD_PRECOMPILED_HEADER)
303
303
304
304
MACRO (GET_NATIVE_PRECOMPILED_HEADER _targetName _input )
305
305
306
+ if (ENABLE_PRECOMPILED_HEADERS )
306
307
if (CMAKE_GENERATOR MATCHES "^Visual.*$" )
307
308
set (${_targetName} _pch ${CMAKE_CURRENT_BINARY_DIR} /${_targetName}_pch.cpp )
308
309
endif ()
310
+ endif ()
309
311
310
312
ENDMACRO (GET_NATIVE_PRECOMPILED_HEADER )
311
313
Original file line number Diff line number Diff line change @@ -887,7 +887,14 @@ function(ocv_target_link_libraries target)
887
887
if (";${LINK_DEPS} ;" MATCHES ";${target} ;" )
888
888
list (REMOVE_ITEM LINK_DEPS "${target} " ) # prevent "link to itself" warning (world problem)
889
889
endif ()
890
- target_link_libraries (${target} ${LINK_DEPS} )
890
+ if (NOT TARGET ${target} )
891
+ if (NOT DEFINED OPENCV_MODULE_${target}_LOCATION )
892
+ message (FATAL_ERROR "ocv_target_link_libraries: invalid target: '${target} '" )
893
+ endif ()
894
+ set (OPENCV_MODULE_${target}_LINK_DEPS ${OPENCV_MODULE_${target}_LINK_DEPS} ${LINK_DEPS} CACHE INTERNAL "" FORCE )
895
+ else ()
896
+ target_link_libraries (${target} ${LINK_DEPS} )
897
+ endif ()
891
898
endfunction ()
892
899
893
900
function (_ocv_append_target_includes target )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ if(HAVE_CUDA)
5
5
endif ()
6
6
7
7
set (STITCHING_CONTRIB_DEPS "opencv_xfeatures2d" )
8
- if (BUILD_SHARED_LIBS AND BUILD_opencv_world )
8
+ if (BUILD_SHARED_LIBS AND BUILD_opencv_world AND OPENCV_WORLD_EXCLUDE_EXTRA_MODULES )
9
9
set (STITCHING_CONTRIB_DEPS "" )
10
10
endif ()
11
11
ocv_define_module (stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ def setDummy(self, path):
193
193
self .tests_dir = os .path .normpath (path )
194
194
195
195
def read (self , path , fname ):
196
- rx = re .compile (r'^opencv_ (\w+)_SOURCE_DIR:STATIC =(.*)$' )
196
+ rx = re .compile (r'^OPENCV_MODULE_opencv_ (\w+)_LOCATION:INTERNAL =(.*)$' )
197
197
module_paths = {} # name -> path
198
198
with open (fname , "rt" ) as cachefile :
199
199
for l in cachefile .readlines ():
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ if(NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK)
2
2
ocv_module_disable (viz )
3
3
endif ()
4
4
5
- include (${VTK_USE_FILE} )
6
5
set (the_description "Viz" )
7
- ocv_define_module (viz opencv_core ${VTK_LIBRARIES} WRAP python )
6
+ ocv_define_module (viz opencv_core WRAP python )
7
+
8
+ include (${VTK_USE_FILE} )
9
+ ocv_target_link_libraries (${the_module} ${VTK_LIBRARIES} )
8
10
9
11
if (APPLE AND BUILD_opencv_viz )
10
- ocv_target_link_libraries (opencv_viz "-framework Cocoa" )
12
+ ocv_target_link_libraries (${the_module} "-framework Cocoa" )
11
13
endif ()
12
14
13
15
if (TARGET opencv_test_viz )
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ endif()
11
11
12
12
function (include_one_module m )
13
13
include ("${OPENCV_MODULE_${m} _LOCATION}/CMakeLists.txt" )
14
+ foreach (var
15
+ CMAKE_CXX_FLAGS CMAKE_C_FLAGS # Propagate warnings settings
16
+ )
17
+ set (${var} "${${var} }" PARENT_SCOPE )
18
+ endforeach ()
14
19
endfunction ()
15
20
16
21
if (NOT OPENCV_INITIAL_PASS )
@@ -35,12 +40,14 @@ ocv_add_module(world opencv_core)
35
40
set (headers_list "HEADERS" )
36
41
set (sources_list "SOURCES" )
37
42
set (link_deps "" )
38
- foreach (m ${OPENCV_MODULE_${the_module}_DEPS} )
43
+ foreach (m ${OPENCV_MODULE_${the_module}_DEPS} opencv_world )
39
44
if (OPENCV_MODULE_${m}_IS_PART_OF_WORLD )
40
45
set (headers_list "${headers_list} ;${OPENCV_MODULE_${m} _HEADERS}" )
41
46
set (sources_list "${sources_list} ;${OPENCV_MODULE_${m} _SOURCES}" )
42
47
endif ()
43
- set (link_deps "${link_deps} ;${OPENCV_MODULE_${m} _LINK_DEPS}" )
48
+ if (NOT " ${OPENCV_MODULE_${m} _LINK_DEPS}" STREQUAL " " )
49
+ list (APPEND link_deps ${OPENCV_MODULE_${m}_LINK_DEPS} )
50
+ endif ()
44
51
endforeach ()
45
52
46
53
ocv_glob_module_sources (${headers_list} ${sources_list} )
You can’t perform that action at this time.
0 commit comments