File: FindQScintilla.cmake

package info (click to toggle)
qgis 2.18.28%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,007,948 kB
  • sloc: cpp: 671,774; python: 158,539; xml: 35,690; ansic: 8,346; sh: 1,766; perl: 1,669; sql: 999; yacc: 836; lex: 461; makefile: 292
file content (82 lines) | stat: -rw-r--r-- 2,715 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Find QScintilla2 PyQt4 module
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# QScintilla2 website: http://www.riverbankcomputing.co.uk/software/qscintilla/
#
# Try to find the QScintilla2 includes and library
# which defines
#
# QSCINTILLA_FOUND - system has QScintilla2
# QSCINTILLA_INCLUDE_DIR - where to find qextscintilla.h
# QSCINTILLA_LIBRARY - where to find the QScintilla2 library
# QSCINTILLA_VERSION_STR - version of library

# copyright (c) 2007 Thomas Moenicke thomas.moenicke@kdemail.net
#
# Redistribution and use is allowed according to the terms of the FreeBSD license.

# Edited by Larry Shaffer, 2012
# NOTE: include after check for Qt


IF(EXISTS QSCINTILLA_VERSION_STR)
  # Already in cache, be silent
  SET(QSCINTILLA_FOUND TRUE)
ELSE(EXISTS QSCINTILLA_VERSION_STR)

  FIND_PATH(QSCINTILLA_INCLUDE_DIR
    NAMES Qsci/qsciglobal.h
    PATHS
      ${Qt5Core_INCLUDE_DIRS}
      "${QT_INCLUDE_DIR}"
      /usr/local/include
      /usr/include
    )

  if(ENABLE_QT5)
    set(QSCINTILLA_LIBRARY_NAMES qscintilla2-qt5 qscintilla2_qt5 libqt5scintilla2 libqscintilla2-qt5 qt5scintilla2 libqscintilla2-qt5.dylib)
  else(ENABLE_QT5)
    set(QSCINTILLA_LIBRARY_NAMES qscintilla2 qscintilla2_qt4 libqscintilla2 libqscintilla2.dylib)
  endif(ENABLE_QT5)

  find_library(QSCINTILLA_LIBRARY
    NAMES ${QSCINTILLA_LIBRARY_NAMES}
    PATHS
      "${QT_LIBRARY_DIR}"
      /usr/local/lib
      /usr/lib
  )

  IF(QSCINTILLA_LIBRARY AND QSCINTILLA_INCLUDE_DIR)
    SET(QSCINTILLA_FOUND TRUE)

    IF(CYGWIN)
      IF(BUILD_SHARED_LIBS)
      # No need to define QSCINTILLA_USE_DLL here, because it's default for Cygwin.
      ELSE(BUILD_SHARED_LIBS)
        SET (QSCINTILLA_DEFINITIONS -DQSCINTILLA_STATIC)
      ENDIF(BUILD_SHARED_LIBS)
    ENDIF(CYGWIN)
  ENDIF(QSCINTILLA_LIBRARY AND QSCINTILLA_INCLUDE_DIR)

  IF(QSCINTILLA_INCLUDE_DIR AND NOT EXISTS QSCINTILLA_VERSION_STR)
    # get QScintilla2 version from header, is optinally retrieved via bindings
    # with Qsci PyQt4 module
    FILE(READ ${QSCINTILLA_INCLUDE_DIR}/Qsci/qsciglobal.h qsci_header)
    STRING(REGEX REPLACE "^.*QSCINTILLA_VERSION_STR +\"([^\"]+)\".*$" "\\1" QSCINTILLA_VERSION_STR "${qsci_header}")
  ENDIF(QSCINTILLA_INCLUDE_DIR AND NOT EXISTS QSCINTILLA_VERSION_STR)

  IF(QSCINTILLA_FOUND)
    IF(NOT QSCINTILLA_FIND_QUIETLY)
      MESSAGE(STATUS "Found QScintilla2: ${QSCINTILLA_LIBRARY} (${QSCINTILLA_VERSION_STR})")
    ENDIF(NOT QSCINTILLA_FIND_QUIETLY)
  ELSE(QSCINTILLA_FOUND)
    IF(QSCINTILLA_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find QScintilla2 library")
    ENDIF(QSCINTILLA_FIND_REQUIRED)
  ENDIF(QSCINTILLA_FOUND)

ENDIF(EXISTS QSCINTILLA_VERSION_STR)

#MARK_AS_ADVANCED(QSCINTILLA_INCLUDE_DIR QSCINTILLA_LIBRARY)