From 74cc1803c4bf812161fda51d9f56024bb23ea033 Mon Sep 17 00:00:00 2001 From: Ethan Rublee Date: Fri, 1 Jul 2011 01:25:27 +0000 Subject: [PATCH] Version modifications. --- OpenCVConfig-version.cmake.in | 24 ++++++++++++------------ opencv-XXX.pc.cmake.in | 13 +++++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 opencv-XXX.pc.cmake.in diff --git a/OpenCVConfig-version.cmake.in b/OpenCVConfig-version.cmake.in index 35c105fd3..b08dbf7d4 100644 --- a/OpenCVConfig-version.cmake.in +++ b/OpenCVConfig-version.cmake.in @@ -1,14 +1,14 @@ -SET(OpenCV_VERSION @OPENCV_VERSION@) -SET(OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@) -SET(OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@) -SET(OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@) +set(OpenCV_VERSION @OPENCV_VERSION@) set(PACKAGE_VERSION ${OpenCV_VERSION}) -if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL ${OpenCV_VERSION_MAJOR}) - set(PACKAGE_VERSION_COMPATIBLE True) # compatible with any version @OPENCV_VERSION_MAJOR@.x.x - if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL ${OpenCV_VERSION_MINOR}) - set(PACKAGE_VERSION_COMPATIBLE True) # compatible with any version @OPENCV_VERSION_MAJOR@.@OPENCV_VERSION_MINOR@.x - if("${PACKAGE_FIND_VERSION_PATCH}" EQUAL ${OpenCV_VERSION_PATCH}) - set(PACKAGE_VERSION_EXACT True) # exact match for patch @OPENCV_VERSION_MAJOR@.@OPENCV_VERSION_MINOR@.@OPENCV_VERSION_PATCH@ - endif() - endif() + +set(PACKAGE_VERSION_EXACT False) +set(PACKAGE_VERSION_COMPATIBLE False) + +if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION}) + set(PACKAGE_VERSION_EXACT True) + set(PACKAGE_VERSION_COMPATIBLE True) +endif() + +if(${PACKAGE_FIND_VERSION} VERSION_LESS ${PACKAGE_VERSION}) + set(PACKAGE_VERSION_COMPATIBLE True) endif() diff --git a/opencv-XXX.pc.cmake.in b/opencv-XXX.pc.cmake.in new file mode 100644 index 000000000..4f6415cab --- /dev/null +++ b/opencv-XXX.pc.cmake.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir_old=@includedir@/opencv +includedir_new=@includedir@ + +Name: OpenCV +Description: Open Source Computer Vision Library +Version: @VERSION@ +Libs: @OpenCV_LIB_COMPONENTS@ +Cflags: -I${includedir_old} -I${includedir_new}