aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditPy/ScintillaEditPy.pro
blob: eaf4aceda9fe2b86ecb3629d0f423d9e76ddb51a (plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
TEMPLATE = lib
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = ScintillaEditPy

# Clear debug & release so that sepbuild.pri can set one or the other
CONFIG -= debug release
CONFIG += c++1z

include(sepbuild.pri)

VERSION = $$SCINTILLA_VERSION

win32 {
	DebugBuild {
		TARGET_EXT = _d.pyd
	}
	else {
		TARGET_EXT = .pyd
	}
}

INCLUDEPATH += ../ScintillaEdit
INCLUDEPATH += ../ScintillaEditBase
INCLUDEPATH += ../../include ../../lexlib ../../src

INCLUDEPATH += $$PY_INCLUDES

INCLUDEPATH += $$SHIBOKEN_INCLUDES
INCLUDEPATH += $$PYSIDE_INCLUDES
INCLUDEPATH += $$PYSIDE_INCLUDES/QtCore
INCLUDEPATH += $$PYSIDE_INCLUDES/QtGui

unix:!mac {
	LIBS += `pkg-config pyside --libs`
}
unix:linux-* {
	# gcc on freebsd 9.2, at least, doesn't support -Wno-empty-body
	# g++ 7.x has deprecated std::auto_ptr but that is used by code generated by Shiboken so
	# turn off warning.
	QMAKE_CXXFLAGS += -Wno-register -Wno-unused-parameter -Wno-empty-body -Wno-deprecated-declarations -Wno-deprecated-copy --std=gnu++17
	LIBS += -ldl
}

macx {
	# Only build for x64 for now
	# QMAKE_CFLAGS = -arch i386 -arch x86_64
	# QMAKE_CXXFLAGS = -arch i386 -arch x86_64
	# QMAKE_LFLAGS = -arch i386 -arch x86_64
	LIBS += -L$$PY_LIBDIR -lpython$$PY_VERSION_SUFFIX
	LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB
	debug {
		LIBS += -lshiboken-python$$PY_VERSION_SUFFIX-dbg
		LIBS += -lpyside-python$$PY_VERSION_SUFFIX-dbg
	}
	else {
		LIBS += -lshiboken-python$$PY_VERSION_SUFFIX
		LIBS += -lpyside-python$$PY_VERSION_SUFFIX
	}
}

win32 {
	DebugBuild {
		DEFINES += DEBUG
		LIBS += -lQtCored4
	}
	else {
		LIBS += -lQtCore
	}
	LIBS += -L$$PY_PREFIX/libs # Note python lib is pulled in via a #pragma
	LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB
	# PySide uses x.y suffix on Windows even though Python uses xy
	DebugBuild {
		LIBS += -lshiboken-python$${PY_VERSION}_d
		LIBS += -lpyside-python$${PY_VERSION}_d
	}
	else {
		LIBS += -lshiboken-python$${PY_VERSION}
		LIBS += -lpyside-python$${PY_VERSION}
	}
}

# Wrapper sources; notifyheader commented out due to shiboken bug
SOURCES += \
	ScintillaEditPy/scintillaeditpy_module_wrapper.cpp \
	ScintillaEditPy/sci_notifyheader_wrapper.cpp \
	ScintillaEditPy/scnotification_wrapper.cpp \
	ScintillaEditPy/scintillaeditbase_wrapper.cpp \
	ScintillaEditPy/scintillaedit_wrapper.cpp \
	ScintillaEditPy/scintilladocument_wrapper.cpp

# ScintillaEdit sources

SOURCES += \
    ../ScintillaEdit/ScintillaEdit.cpp \
    ../ScintillaEdit/ScintillaDocument.cpp \
    ../ScintillaEditBase/PlatQt.cpp \
    ../ScintillaEditBase/ScintillaQt.cpp \
    ../ScintillaEditBase/ScintillaEditBase.cpp \
    $$files(../../src/*.cxx, false) \
    $$files(../../lexlib/*.cxx, false) \
    $$files(../../lexers/*.cxx, false)


# HEADERS is used to find what needs to be run through moc
HEADERS  += \
    ../ScintillaEdit/ScintillaEdit.h \
    ../ScintillaEdit/ScintillaDocument.h \
    ../ScintillaEditBase/ScintillaQt.h \
    ../ScintillaEditBase/ScintillaEditBase.h

DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1
CONFIG(release, debug|release) {
    DEFINES += NDEBUG=1
}

DESTDIR = ../../bin

unix:!mac {
	# Rename to not have 'lib' at start
	QMAKE_POST_LINK += rm -rf ../../bin/ScintillaEditPy.so && ln -s libScintillaEditPy.so ../../bin/ScintillaEditPy.so
}

macx {
	# Rename to .so and not have 'lib' at start
	QMAKE_POST_LINK += rm -rf ../../bin/ScintillaEditPy.so && ln -s libScintillaEditPy.dylib ../../bin/ScintillaEditPy.so
}