FS#60622 - Building OpenCV projects with pkgbuild fails when VTK is not installed

Attached to Project: Arch Linux
Opened by Johannes Jordan (FoPref) - Sunday, 28 October 2018, 16:53 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 28 October 2018, 17:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
OpenCV package includes opencv_viz, which depends on VTK. Build configuration helpers like pkgconf, CMake include opencv_viz.
But VTK is supposed to be an optional dependency of OpenCV. On systems without vtk package installed, builds fail.

Additional info:
* most recent opencv package
* see https://bugs.archlinux.org/task/41923


Steps to reproduce:

**** USING PKGCONF

# echo 'int main() {}' > test.cpp # pkgconf --libs --cflags opencv | xargs g++ test.cpp

Note that pkgconf/pkg-config is often wrapped by build systems, e.g. to build a QMake project with OpenCV you do PKGCONFIG += opencv

**** USING CMAKE
Many projects use CMake as a high-level build system, we follow the tutorial from OpenCV:
https://docs.opencv.org/3.4.3/db/df5/tutorial_linux_gcc_cmake.html

# cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( DisplayImage test.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )
# cmake .
# make


We obtain the same result in both cases: Linker failure due to VTK not found.
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 28 October 2018, 17:56 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#59745 
Comment by Johannes Jordan (FoPref) - Sunday, 28 October 2018, 17:01 GMT
Sorry the bug title is wrong it should be Building OpenCV projects with pkgconf-based Makefile or CMake fails when VTK is not installed

Loading...