The digikam/kipi-plugins ports contain a very old FindOpenCV.cmake that does not know about TBB. When this option is enabled in OpenCV, linking fails. A possible solution is to provide FindOpenCV.cmake similar to what is done with FindOpenCVCore.cmake so that local versions get overridden by the one in cmake modules path.
Details: /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector -fno-strict-aliasing -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -Woverloaded-virtual -fno-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -Wno-return-type-c-linkage -O2 -DNDEBUG -DQT_NO_DEBUG -fstack-protector CMakeFiles/testipp.dir/testipp_automoc.cpp.o CMakeFiles/testipp.dir/testForIPP.cpp.o -o testipp -Wl,-rpath,/usr/local/lib /usr/local/lib/libopencv_contrib.so.2.4.13 /usr/local/lib/libopencv_legacy.so.2.4.13 /usr/local/lib/libopencv_objdetect.so.2.4.13 /usr/local/lib/libopencv_calib3d.so.2.4.13 /usr/local/lib/libopencv_features2d.so.2.4.13 /usr/local/lib/libopencv_highgui.so.2.4.13 /usr/local/lib/libopencv_flann.so.2.4.13 /usr/local/lib/libopencv_ml.so.2.4.13 /usr/local/lib/libopencv_video.so.2.4.13 /usr/local/lib/libopencv_imgproc.so.2.4.13 /usr/local/lib/libopencv_core.so.2.4.13 -lm -lpthread -ltbb /usr/bin/ld: cannot find -ltbb c++: error: linker command failed with exit code 1 (use -v to see invocation) Note that all opencv libraries are referenced by full path, but tbb is not and no -L/usr/local/lib is present. /usr/local/bin/pkgconf --libs opencv -L/usr/local/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -ltbb -lGL -lGLU -lpthread -lm
It probably just adds opencv instead of the values found via pkg-config. Which one is the affected port?
Created attachment 183477 [details] untested patch Could you give the attached patch a try (I have not yet tested it).
Created attachment 183478 [details] workaround the issue by passing -L/usr/local/lib via USES=localbase:ldflags This one should actually work as a workaround.
Work around does it's job. Sorry for the late response.
A commit references this bug: Author: tcberner Date: Thu Jul 6 15:08:42 UTC 2017 New revision: 445158 URL: https://svnweb.freebsd.org/changeset/ports/445158 Log: Make sure $LOCALBASE/lib is in the linker search paths. * Otherwise linking may fail with OpenCV was compiled with TBB. PR: 219981 Reported by: Melvyn Sopacua <m.r.sopacua@gmail.com> Changes: head/graphics/kipi-plugin-removeredeyes/Makefile