-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMLibPng.class.st
109 lines (88 loc) · 2.33 KB
/
CMLibPng.class.st
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
Class {
#name : #CMLibPng,
#superclass : #CMCairoBundle,
#category : #'CMakeVMMaker-Libs'
}
{ #category : #'as yet unclassified' }
CMLibPng class >> canonicalName [
^ 'libpng'
]
{ #category : #'package properties' }
CMLibPng >> archiveMD5Sum [
^ '39a35257cd888d29f1d000c2ffcc79eb'
]
{ #category : #'generating actions' }
CMLibPng >> build [
gen
puts:
'
add_custom_command(OUTPUT "${libpngInstalled}"
COMMAND ./configure --prefix=''${installPrefix}'' PKG_CONFIG="${pkgconfigPath}"
PKG_CONFIG_PATH="${installPrefix}/lib/pkgconfig" CFLAGS=''-arch i386'' LDFLAGS=''-arch i386''
COMMAND make
COMMAND make install
WORKING_DIRECTORY "${libSourcesDir}"
DEPENDS "${unpackTarget}" pkg-config
COMMENT "Building ${libName}"
)
'
]
{ #category : #'generating actions' }
CMLibPng >> copyArtefacts [
gen puts:
'add_custom_command(
OUTPUT "${externalModulesDir}/${libraryFileName}"
COMMAND cp ${libpngInstalled} ${externalModulesDir}/${libraryFileName}
DEPENDS "${libpngInstalled}"
)'
]
{ #category : #'generating actions' }
CMLibPng >> defineAsTarget [
gen puts:
'add_custom_target(${libName}
DEPENDS "${externalModulesDir}/${libraryFileName}"
)'
]
{ #category : #'generating actions' }
CMLibPng >> defineGlobalTargets [
| var |
var := self canonicalName , '_LIB'.
vmGen set: var toString: self targetForLinking.
"
define a library as imported one
and make it depend from it's build target
"
vmGen
puts:
('add_library("{1}" SHARED IMPORTED GLOBAL)
set_target_properties("{1}" PROPERTIES IMPORTED_LOCATION "{1}")
add_dependencies("{1}" "{2}")
' format: { '${',var, '}' . self buildTarget }
).
vmGen cmd: 'add_dependencies' params:
vmGen moduleName , ' ' , self buildTarget
]
{ #category : #'package properties' }
CMLibPng >> dependencies [
^ #( 'pkg-config' )
]
{ #category : #'package properties' }
CMLibPng >> downloadURL [
^ 'ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng12/libpng-1.2.49.tar.gz'
]
{ #category : #'package properties' }
CMLibPng >> libraryFileName [
^ 'libpng12.0.dylib'
]
{ #category : #'generating actions' }
CMLibPng >> setVariables [
super setVariables.
"add include path"
gen
set: #libraryFileName to: self libraryFileName;
set: #libpngInstalled toString: '${installPrefix}/lib/${libraryFileName}'.
]
{ #category : #'package properties' }
CMLibPng >> unpackedDirName [
^ 'libpng-1.2.49'
]