8b12a2
diff -up OpenCV-2.4.2/cmake/OpenCVGenPkgconfig.cmake.pkgcmake OpenCV-2.4.2/cmake/OpenCVGenPkgconfig.cmake
8b12a2
--- OpenCV-2.4.2/cmake/OpenCVGenPkgconfig.cmake.pkgcmake	2012-06-29 00:55:15.000000000 +0200
8b12a2
+++ OpenCV-2.4.2/cmake/OpenCVGenPkgconfig.cmake	2012-07-09 14:53:33.338597708 +0200
8b12a2
@@ -10,7 +10,7 @@
8b12a2
 # -------------------------------------------------------------------------------------------
8b12a2
 set(prefix      "${CMAKE_INSTALL_PREFIX}")
8b12a2
 set(exec_prefix "\${prefix}")
8b12a2
-set(libdir      "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
8b12a2
+set(libdir      "\${prefix}/${OPENCV_LIB_INSTALL_PATH}")
8b12a2
 set(includedir  "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
8b12a2
 set(VERSION     ${OPENCV_VERSION})
8b12a2
 
8b12a2
@@ -36,7 +36,7 @@ ocv_list_reverse(OpenCV_LIB_COMPONENTS)
8b12a2
 ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
8b12a2
 
8b12a2
 #build the list of components
8b12a2
-set(OpenCV_LIB_COMPONENTS_ "")
8b12a2
+set(OpenCV_LIB_COMPONENTS_ "-L\${libdir}")
8b12a2
 foreach(CVLib ${OpenCV_LIB_COMPONENTS})
8b12a2
   get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
8b12a2
   get_filename_component(libname "${libpath}" NAME)
8b12a2
@@ -51,8 +51,10 @@ foreach(CVLib ${OpenCV_LIB_COMPONENTS})
8b12a2
   else()
8b12a2
     set(installDir "${OPENCV_LIB_INSTALL_PATH}")
8b12a2
   endif()
8b12a2
-
8b12a2
-  set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
8b12a2
+  string(REPLACE "libopencv" "-lopencv" libname "${libname}")
8b12a2
+  string(REPLACE ".so"    "" libname "${libname}")
8b12a2
+  string(REPLACE ".dylib" "" libname "${libname}")
8b12a2
+  set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} ${libname}")
8b12a2
 endforeach()
8b12a2
 
8b12a2
 # add extra dependencies required for OpenCV