Skip to content

Commit 11a726c

Browse files
committed
Merge pull request opencv#9057 from alalek:static_build_workaround
2 parents c3586b8 + c5a6846 commit 11a726c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

modules/viz/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ endif()
44

55
set(the_description "Viz")
66
include(${VTK_USE_FILE})
7+
8+
if(NOT BUILD_SHARED_LIBS)
9+
# We observed conflict between builtin 3rdparty libraries and
10+
# system-wide similar libraries (but with different versions) from VTK dependencies
11+
set(_conflicts "")
12+
foreach(dep ${VTK_LIBRARIES})
13+
if(("${dep}" MATCHES "libz\\." AND BUILD_ZLIB)
14+
OR ("${dep}" MATCHES "libjpeg\\." AND BUILD_JPEG)
15+
OR ("${dep}" MATCHES "libpng\\." AND BUILD_PNG)
16+
OR ("${dep}" MATCHES "libtiff\\." AND BUILD_TIFF)
17+
)
18+
list(APPEND _conflicts "${dep}")
19+
endif()
20+
endforeach()
21+
if(_conflicts)
22+
message(STATUS "Disabling VIZ module due conflicts with VTK dependencies: ${_conflicts}")
23+
ocv_module_disable(viz)
24+
endif()
25+
endif()
26+
727
ocv_define_module(viz opencv_core WRAP python)
828
ocv_target_link_libraries(${the_module} ${VTK_LIBRARIES})
929

0 commit comments

Comments
 (0)