forked from planetfederal/QGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindQScintilla.cmake
78 lines (65 loc) · 2.47 KB
/
FindQScintilla.cmake
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
# 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 qsciglobal.h
PATHS
"${QT_INCLUDE_DIR}/Qsci"
/usr/include
/usr/include/Qsci
/usr/local/include/Qsci
)
FIND_LIBRARY(QSCINTILLA_LIBRARY
NAMES qscintilla2 libqscintilla2 libqscintilla2.dylib
PATHS
"${QT_LIBRARY_DIR}"
/usr/lib
/usr/local/lib
)
IF(QSCINTILLA_LIBRARY)
# QSCINTILLA_INCLUDE_DIR is not required at this time (Oct 2012) since only
# Qsci PyQt4 module is used, though lib is needed for Mac bundling
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)
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}/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)