-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindQsci.cmake
50 lines (42 loc) · 1.55 KB
/
FindQsci.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
# Find QScintilla2 PyQt module
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# QScintilla2 website: http://www.riverbankcomputing.co.uk/software/qscintilla/
#
# Find the installed version of QScintilla2 module. FindQsci should be called
# after Python has been found.
#
# This file defines the following variables:
#
# QSCI_FOUND - system has QScintilla2 PyQt module
#
# QSCI_MOD_VERSION_STR - The version of Qsci module as a human readable string.
#
# Copyright (c) 2012, Larry Shaffer <[email protected]>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF(EXISTS QSCI_MOD_VERSION_STR)
# Already in cache, be silent
SET(QSCI_FOUND TRUE)
ELSE(EXISTS QSCI_MOD_VERSION_STR)
FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})
SET(QSCI_VER 5)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)
IF(qsci_ver)
STRING(REGEX REPLACE "^qsci_version_str:([^\n]+).*$" "\\1" QSCI_MOD_VERSION_STR ${qsci_ver})
SET(QSCI_FOUND TRUE)
ENDIF(qsci_ver)
IF(QSCI_FOUND)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR} ${SIP_DEFAULT_SIP_DIR}
)
IF(NOT QSCI_FIND_QUIETLY)
MESSAGE(STATUS "Found QScintilla2 PyQt module: ${QSCI_MOD_VERSION_STR}")
ENDIF(NOT QSCI_FIND_QUIETLY)
ELSE(QSCI_FOUND)
IF(QSCI_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find QScintilla2 PyQt module")
ENDIF(QSCI_FIND_REQUIRED)
ENDIF(QSCI_FOUND)
ENDIF(EXISTS QSCI_MOD_VERSION_STR)