summaryrefslogtreecommitdiffstats
path: root/scribus/designer/smwidgets/make_cmakelists.py
blob: d14404dcf5957d205105a756c8b412b8423d7548 (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
src = [
'smalignselectplugin',
'smcolorcomboplugin',
'smfontcombohplugin',
'smsccomboboxplugin',
'smscrspinboxplugin',
'smshadebuttonplugin',
'smspinboxplugin',
'smstyleselectplugin',
'smtabrulerplugin'
]


out = [
'''INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/scribus
)''']

template = '''
SET(SCRIBUS_%s_PLUGIN_MOC_CLASSES
%s.h
../../smwidgets.h
)

SET(SCRIBUS_%s_PLUGIN_SOURCES
%s.cpp
../../smwidgets.cpp
)
'''

for i in src:
	up = i.upper()
	out.append(template % (up, i, up, i))

template = '\nSET(SCRIBUS_%s_PLUGIN "scribus_%s")'
for i in src:
	out.append(template % (i.upper(), i))

template = '\nQT4_WRAP_CPP(SCRIBUS_%s_PLUGIN_MOC_SOURCES ${SCRIBUS_%s_PLUGIN_MOC_CLASSES})'
for i in src:
	out.append(template % (i.upper(), i.upper()))
	
template = '''
ADD_LIBRARY(${SCRIBUS_%s_PLUGIN}
	SHARED ${SCRIBUS_%s_PLUGIN_SOURCES}
	${SCRIBUS_%s_PLUGIN_MOC_SOURCES})
TARGET_LINK_LIBRARIES(${SCRIBUS_%s_PLUGIN} ${QT_LIBRARIES} )
'''
for i in src:
	out.append(template % (i.upper(), i.upper(), i.upper(), i.upper()))

out.append('\nIF(APPLE)')
template = '''
  TARGET_LINK_LIBRARIES(${SCRIBUS_%s_PLUGIN} "-undefined dynamic_lookup")
'''
for i in src:
	out.append(template % i.upper())
out.append('ENDIF(APPLE)')

print ''.join(out)