summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2013-07-24 11:43:22 -0400
committerTom Rondeau <tom@trondeau.com>2013-07-24 11:43:22 -0400
commit69d0a9b61c0e3be8919d43652e47c4f85ac3a7d9 (patch)
tree69ec7595e4a36b0184cbbd6e5f8ed6c3091d922e /cmake
parentd29ea522c3612bccea842ef4ccae70eabb69756c (diff)
parentd3f1e8fcafe6a4b0eabe5691801722c43eac4a70 (diff)
Merge branch 'maint'
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindQwt.cmake76
1 files changed, 48 insertions, 28 deletions
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index eba3e64e31..248d8034b4 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -1,37 +1,57 @@
# - try to find Qwt libraries and include files
-# QWT_INCLUDE_DIR where to find qwt_plot.h, etc.
+# QWT_INCLUDE_DIR where to find qwt_global.h, etc.
# QWT_LIBRARIES libraries to link against
# QWT_FOUND If false, do not try to use Qwt
+# qwt_global.h holds a string with the QWT version;
+# test to make sure it's at least 5.2
-find_path (QWT_INCLUDE_DIRS
- NAMES qwt_plot.h
- HINTS
- ${CMAKE_INSTALL_PREFIX}/include/qwt
- PATHS
- /usr/local/include/qwt-qt4
- /usr/local/include/qwt
- /usr/include/qwt-qt4
- /usr/include/qwt
- /opt/local/include/qwt
- /opt/local/lib/qwt.framework/Headers
- /sw/include/qwt
+find_path(QWT_INCLUDE_DIRS
+ NAMES qwt_global.h
+ HINTS
+ ${CMAKE_INSTALL_PREFIX}/include/qwt
+ PATHS
+ /usr/local/include/qwt-qt4
+ /usr/local/include/qwt
+ /usr/include/qwt-qt4
+ /usr/include/qwt
+ /opt/local/include/qwt
+ /opt/local/lib/qwt.framework/Headers
+ /sw/include/qwt
)
find_library (QWT_LIBRARIES
- NAMES qwt qwt-qt4
- HINTS
- ${CMAKE_INSTALL_PREFIX}/lib
- ${CMAKE_INSTALL_PREFIX}/lib64
- PATHS
- /usr/local/lib
- /usr/lib
- /opt/local/lib
- /opt/local/lib/qwt.framework
- /sw/lib
+ NAMES qwt qwt-qt4
+ HINTS
+ ${CMAKE_INSTALL_PREFIX}/lib
+ ${CMAKE_INSTALL_PREFIX}/lib64
+ PATHS
+ /usr/local/lib
+ /usr/lib
+ /opt/local/lib
+ /opt/local/lib/qwt.framework
+ /sw/lib
)
-# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
-# all listed variables are TRUE
-include ( FindPackageHandleStandardArgs )
-find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
-MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)
+set(QWT_FOUND FALSE)
+if(QWT_INCLUDE_DIRS)
+ file(STRINGS "${QWT_INCLUDE_DIRS}/qwt_global.h"
+ QWT_STRING_VERSION REGEX "QWT_VERSION_STR")
+ string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" QWT_VERSION ${QWT_STRING_VERSION})
+ string(COMPARE LESS ${QWT_VERSION} "5.2.0" QWT_WRONG_VERSION)
+
+ message(STATUS "QWT Version: ${QWT_VERSION}")
+ if(NOT QWT_WRONG_VERSION)
+ set(QWT_FOUND TRUE)
+ else(NOT QWT_WRONG_VERSION)
+ message(STATUS "QWT Version must be >= 5.2, Found ${QWT_VERSION}")
+ endif(NOT QWT_WRONG_VERSION)
+
+endif(QWT_INCLUDE_DIRS)
+
+if(QWT_FOUND)
+ # handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
+ # all listed variables are TRUE
+ include ( FindPackageHandleStandardArgs )
+ find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
+ MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)
+endif(QWT_FOUND) \ No newline at end of file