<div dir="ltr">Patch:<div><br></div><div> <a href="http://review.source.kitware.com/#/c/20575/">http://review.source.kitware.com/#/c/20575/</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 3:10 PM, Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Arnaud,<br>
<br>
This means that OpenCV's *Targets.cmake file is not read. This file<br>
informs CMake of all the imported library targets' full paths.<br>
<br>
To ensure this file is read, 'find_package(OpenCV)' should be called.<br>
This reads in the OpenCVConfig.cmake file, which should read in the<br>
OpenCVTargets.cmake file (I have not checked if these files have these<br>
exact names, but that is the idea).<br>
<br>
To make this happen,<br>
<br>
Modules/Video/BridgeOpenCV/CMakeLists.txt<br>
<br>
should set ITKVideoBridgeOpenCV_EXPORT_CODE_BUILD and<br>
ITKVideoBridgeOpen_EXPORT_CODE_INSTALL to strings that contain<br>
<br>
set(OpenCV_DIR \"${OpenCV_DIR}\")<br>
find_package(OpenCV REQUIRED)<br>
<br>
The contents of these variable are added to a module's CMake<br>
information file, which is loaded when the module is loaded.<br>
<br>
The file<br>
<br>
Modules/ThirdParty/DCMTK/CMakeLists.txt<br>
<br>
serves as a good example.<br>
<br>
HTH,<br>
Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Oct 1, 2015 at 9:39 AM, Arnaud Gelas <<a href="mailto:arnaudgelas@gmail.com">arnaudgelas@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I have built ITK with BridgeOpenCV turned ON and when I compile ITKExamples,<br>
> I get the following linking errors:<br>
><br>
> FAILED: : && /usr/lib/ccache/c++ -msse2 -g<br>
> src/CMakeFiles/ImageCompareCommand.dir/ImageCompareCommand.cxx.o -o<br>
> bin/ImageCompareCommand -rdynamic<br>
> /home/arnaud/install/lib/libITKIOBMP-4.9.so.1 -lexpat -lz<br>
> /home/arnaud/install/lib/libITKIOGDCM-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOGIPL-4.9.so.1 -ljpeg<br>
> /home/arnaud/install/lib/libITKIOJPEG-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOMeta-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIONIFTI-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIONRRD-4.9.so.1 -lpng<br>
> /home/arnaud/install/lib/libITKIOPNG-4.9.so.1 -ltiff<br>
> /home/arnaud/install/lib/libITKIOVTK-4.9.so.1<br>
> /home/arnaud/install/lib/libITKLabelMap-4.9.so.1<br>
> /home/arnaud/install/lib/libITKQuadEdgeMesh-4.9.so.1<br>
> /home/arnaud/install/lib/libITKPolynomials-4.9.so.1<br>
> /home/arnaud/install/lib/libITKBiasCorrection-4.9.so.1<br>
> /home/arnaud/install/lib/libITKBioCell-4.9.so.1<br>
> /home/arnaud/install/lib/libITKDICOMParser-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOSpatialObjects-4.9.so.1<br>
> /home/arnaud/install/lib/libITKFEM-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOMesh-4.9.so.1<br>
> /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5_cpp.so<br>
> /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so -lpthread -ldl -lm<br>
> /home/arnaud/install/lib/libITKIOBioRad-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOCSV-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOGE-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOSiemens-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOHDF5-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOLSM-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOMRC-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOStimulate-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOTransformHDF5-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOTransformInsightLegacy-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOTransformMatlab-4.9.so.1<br>
> /home/arnaud/install/lib/libITKKLMRegionGrowing-4.9.so.1<br>
> /home/arnaud/install/lib/libITKWatersheds-4.9.so.1<br>
> /home/arnaud/install/lib/libITKOptimizersv4-4.9.so.1<br>
> /home/arnaud/install/lib/libITKVideoBridgeOpenCV-4.9.so.1<br>
> /home/arnaud/install/lib/libITKVtkGlue-4.9.so.1<br>
> /home/arnaud/install/lib/libitkgdcmMSFF-4.9.so.1<br>
> /home/arnaud/install/lib/libitkgdcmDICT-4.9.so.1<br>
> /home/arnaud/install/lib/libitkgdcmIOD-4.9.so.1<br>
> /home/arnaud/install/lib/libitkgdcmDSED-4.9.so.1<br>
> /home/arnaud/install/lib/libitkgdcmCommon-4.9.so.1<br>
> /home/arnaud/install/lib/libITKNrrdIO-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOXML-4.9.so.1<br>
> /home/arnaud/install/lib/libITKMetaIO-4.9.so.1<br>
> /home/arnaud/install/lib/libITKgiftiio-4.9.so.1 -lexpat<br>
> /home/arnaud/install/lib/libITKniftiio-4.9.so.1<br>
> /home/arnaud/install/lib/libITKznz-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOIPL-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOTIFF-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOTransformBase-4.9.so.1<br>
> /home/arnaud/install/lib/libITKSpatialObjects-4.9.so.1<br>
> /home/arnaud/install/lib/libITKMesh-4.9.so.1<br>
> /home/arnaud/install/lib/libITKPath-4.9.so.1<br>
> /home/arnaud/install/lib/libITKOptimizers-4.9.so.1<br>
> /home/arnaud/install/lib/libITKStatistics-4.9.so.1<br>
> /home/arnaud/install/lib/libitkNetlibSlatec-4.9.so.1<br>
> /home/arnaud/install/lib/libITKVideoIO-4.9.so.1<br>
> /home/arnaud/install/lib/libITKIOImageBase-4.9.so.1<br>
> /home/arnaud/install/lib/libITKVideoCore-4.9.so.1 -lopencv_videostab<br>
> -lopencv_video -lopencv_ts -lopencv_superres -lopencv_stitching<br>
> -lopencv_photo -lopencv_ocl -lopencv_objdetect -lopencv_nonfree -lopencv_ml<br>
> -lopencv_legacy -lopencv_imgproc -lopencv_highgui -lopencv_gpu<br>
> -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib<br>
> -lopencv_calib3d -ljpeg -lpng -ltiff<br>
> /home/arnaud/install/lib/libITKVTK-4.9.so.1<br>
> /home/arnaud/install/lib/libITKCommon-4.9.so.1<br>
> /home/arnaud/install/lib/libitkdouble-conversion-4.9.so.1<br>
> /home/arnaud/install/lib/libitksys-4.9.so.1<br>
> /home/arnaud/install/lib/libITKVNLInstantiation-4.9.so.1<br>
> /home/arnaud/install/lib/libitkvnl_algo-4.9.so.1<br>
> /home/arnaud/install/lib/libitkv3p_lsqr-4.9.so.1<br>
> /home/arnaud/install/lib/libitkvnl-4.9.so.1<br>
> /home/arnaud/install/lib/libitkvcl-4.9.so.1<br>
> /home/arnaud/install/lib/libitkv3p_netlib-4.9.so.1 -lm -lpthread -lm<br>
> /home/arnaud/install/lib/libvtkRenderingOpenGL-6.3.so.1 -lGLU -lSM -lICE<br>
> -lX11 -lXext -lSM -lICE -lX11 -lXext -lXt<br>
> /home/arnaud/install/lib/libvtkImagingHybrid-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkIOImage-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkDICOMParser-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkIOCore-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkmetaio-6.3.so.1 -lz<br>
> /home/arnaud/install/lib/libvtkRenderingFreeType-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkftgl-6.3.so.1 -lfreetype -lGL<br>
> /home/arnaud/install/lib/libvtkInteractionStyle-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkRenderingCore-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonColor-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersGeometry-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersExtraction-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersStatistics-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkImagingFourier-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkalglib-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersSources-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersGeneral-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkFiltersCore-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonComputationalGeometry-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkImagingSources-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkImagingCore-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonExecutionModel-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonDataModel-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonMisc-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonSystem-6.3.so.1<br>
> /home/arnaud/install/lib/libvtksys-6.3.so.1 -ldl<br>
> /home/arnaud/install/lib/libvtkCommonTransforms-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonMath-6.3.so.1<br>
> /home/arnaud/install/lib/libvtkCommonCore-6.3.so.1<br>
> -Wl,-rpath,/home/arnaud/install/lib:/usr/lib/x86_64-linux-gnu/hdf5/serial/lib<br>
> -Wl,-rpath-link,/home/arnaud/install/lib && :<br>
> /usr/bin/ld: cannot find -lopencv_videostab<br>
> /usr/bin/ld: cannot find -lopencv_video<br>
> /usr/bin/ld: cannot find -lopencv_ts<br>
> /usr/bin/ld: cannot find -lopencv_superres<br>
> /usr/bin/ld: cannot find -lopencv_stitching<br>
> /usr/bin/ld: cannot find -lopencv_photo<br>
> /usr/bin/ld: cannot find -lopencv_ocl<br>
> /usr/bin/ld: cannot find -lopencv_objdetect<br>
> /usr/bin/ld: cannot find -lopencv_nonfree<br>
> /usr/bin/ld: cannot find -lopencv_ml<br>
> /usr/bin/ld: cannot find -lopencv_legacy<br>
> /usr/bin/ld: cannot find -lopencv_imgproc<br>
> /usr/bin/ld: cannot find -lopencv_highgui<br>
> /usr/bin/ld: cannot find -lopencv_gpu<br>
> /usr/bin/ld: cannot find -lopencv_flann<br>
> /usr/bin/ld: cannot find -lopencv_features2d<br>
> /usr/bin/ld: cannot find -lopencv_core<br>
> /usr/bin/ld: cannot find -lopencv_contrib<br>
> /usr/bin/ld: cannot find -lopencv_calib3d<br>
> collect2: error: ld returned 1 exit status<br>
> [14/255] Building CXX object<br>
> src/Core/Common/ObserveAnEvent/CMakeFiles/ObserveAnEvent.dir/Code.cxx.o<br>
><br>
><br>
> It actually occurs for all executables...<br>
><br>
> ${ITK_LIBRARIES} does not contain ${OpenCV_LIBS}, leading to this error.<br>
> Correct?<br>
><br>
> What would be the best/correct way to fix this error?<br>
><br>
><br>
</div></div></blockquote></div><br></div>