Ticket #32528: patch-OpenCVConfig.cmake.in.diff
File patch-OpenCVConfig.cmake.in.diff, 1.5 KB (added by marin.saric@…, 13 years ago) |
---|
-
OpenCVConfig.cmake.in
old new 40 40 # Some additional settings are required if OpenCV is built as static libs 41 41 set(OpenCV_SHARED @BUILD_SHARED_LIBS@) 42 42 43 # OpenCV can exist for both shared and static libraries 44 set(OPENCV_BUILT_SHARED_AND_STATIC @OPENCV_BUILT_SHARED_AND_STATIC@) 45 if(OPENCV_BUILT_SHARED_AND_STATIC) 46 if (DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS) 47 set(OpenCV_SHARED OFF) 48 else() 49 set(OpenCV_SHARED ON) 50 endif() 51 endif(OPENCV_BUILT_SHARED_AND_STATIC) 52 43 53 # Enables mangled install paths, that help with side by side installs 44 54 set(OpenCV_USE_MANGLED_PATHS @OPENCV_MANGLED_INSTALL_PATHS@) 45 55 … … 101 111 endif() 102 112 endforeach() 103 113 else() 114 # Let cmake properly locate each OpenCV library 104 115 foreach(__CVLIB ${OpenCV_LIB_COMPONENTS}) 105 SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}) 116 FIND_LIBRARY(${__CVLIB}_LIBRARY 117 NAMES ${__CVLIB} 118 PATHS ${OpenCV_LIB_DIR}) 119 SET(OpenCV_LIBS ${OpenCV_LIBS} ${${__CVLIB}_LIBRARY}) 106 120 endforeach() 107 121 endif() 108 122 … … 139 153 endif() 140 154 141 155 if (APPLE) 142 set(OpenCV_LIBS ${OpenCV_LIBS} "-lbz2" "-framework Cocoa" "-framework QuartzCore" "-framework QTKit") 156 FIND_LIBRARY(BZ2_LIBRARY NAMES bz2 REQUIRED) 157 158 list(APPEND OpenCV_LIBS ${BZ2_LIBRARY} "-framework Cocoa" "-framework QuartzCore" "-framework QTKit") 143 159 endif() 144 160 ENDIF() 145 161