Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. # Qt Widgets for Technical Applications
  2. # available at http://www.http://qwt.sourceforge.net/
  3. #
  4. # The module defines the following variables:
  5. # QWT_FOUND - the system has Qwt
  6. # QWT_INCLUDE_DIR - where to find qwt_plot.h
  7. # QWT_INCLUDE_DIRS - qwt includes
  8. # QWT_LIBRARY - where to find the Qwt library
  9. # QWT_LIBRARIES - aditional libraries
  10. # QWT_MAJOR_VERSION - major version
  11. # QWT_MINOR_VERSION - minor version
  12. # QWT_PATCH_VERSION - patch version
  13. # QWT_VERSION_STRING - version (ex. 5.2.1)
  14. # QWT_ROOT_DIR - root dir (ex. /usr/local)
  15.  
  16. #=============================================================================
  17. # Copyright 2010-2013, Julien Schueller
  18. # All rights reserved.
  19. #
  20. # Redistribution and use in source and binary forms, with or without
  21. # modification, are permitted provided that the following conditions are met:
  22. #
  23. # 1. Redistributions of source code must retain the above copyright notice, this
  24. # list of conditions and the following disclaimer.
  25. # 2. Redistributions in binary form must reproduce the above copyright notice,
  26. # this list of conditions and the following disclaimer in the documentation
  27. # and/or other materials provided with the distribution.
  28. #
  29. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  30. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  31. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  32. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  33. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  34. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  35. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  36. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39.  
  40. # The views and conclusions contained in the software and documentation are those
  41. # of the authors and should not be interpreted as representing official policies,
  42. # either expressed or implied, of the FreeBSD Project.
  43. #=============================================================================
  44.  
  45.  
  46. find_path ( QWT_INCLUDE_DIR
  47. NAMES qwt_plot.h
  48. HINTS ${QT_INCLUDE_DIR}
  49. PATH_SUFFIXES qwt qwt-qt3 qwt-qt4 qwt-qt5
  50. )
  51.  
  52. set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} )
  53.  
  54. # version
  55. set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h )
  56. if ( EXISTS ${_VERSION_FILE} )
  57. file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" )
  58. if ( _VERSION_LINE )
  59. string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"(.*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" )
  60. string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QWT_MAJOR_VERSION "${QWT_VERSION_STRING}" )
  61. string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QWT_MINOR_VERSION "${QWT_VERSION_STRING}" )
  62. string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QWT_PATCH_VERSION "${QWT_VERSION_STRING}" )
  63. endif ()
  64. endif ()
  65.  
  66.  
  67. # check version
  68. set ( _QWT_VERSION_MATCH TRUE )
  69. if ( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
  70. if ( Qwt_FIND_VERSION_EXACT )
  71. if ( NOT Qwt_FIND_VERSION VERSION_EQUAL QWT_VERSION_STRING )
  72. set ( _QWT_VERSION_MATCH FALSE )
  73. endif ()
  74. else ()
  75. if ( QWT_VERSION_STRING VERSION_LESS Qwt_FIND_VERSION )
  76. set ( _QWT_VERSION_MATCH FALSE )
  77. endif ()
  78. endif ()
  79. endif ()
  80.  
  81.  
  82. find_library ( QWT_LIBRARY
  83. NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
  84. )
  85.  
  86. set ( QWT_LIBRARIES ${QWT_LIBRARY} )
  87.  
  88.  
  89. # try to guess root dir from include dir
  90. if ( QWT_INCLUDE_DIR )
  91. string ( REGEX REPLACE "(.*)/include.*" "\\1" QWT_ROOT_DIR ${QWT_INCLUDE_DIR} )
  92. # try to guess root dir from library dir
  93. elseif ( QWT_LIBRARY )
  94. string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QWT_ROOT_DIR ${QWT_LIBRARY} )
  95. endif ()
  96.  
  97.  
  98. # handle the QUIETLY and REQUIRED arguments
  99. include ( FindPackageHandleStandardArgs )
  100. find_package_handle_standard_args( Qwt6 DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH )
  101.  
  102. mark_as_advanced (
  103. QWT_LIBRARY
  104. QWT_LIBRARIES
  105. QWT_INCLUDE_DIR
  106. QWT_INCLUDE_DIRS
  107. QWT_MAJOR_VERSION
  108. QWT_MINOR_VERSION
  109. QWT_PATCH_VERSION
  110. QWT_VERSION_STRING
  111. QWT_ROOT_DIR
  112. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement