-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMakeAddLibrary.class.st
95 lines (71 loc) · 2.17 KB
/
CMakeAddLibrary.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
"
I encapsulate the simplest version of the CMake add_library command.
If you want additional versions, either copy me or enhance me.
You can see the documentation with
cmake --help-command add_library
add_library
-----------
Add a library to the project using the specified source files.
::
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
source1 [source2 ...])
"
Class {
#name : #CMakeAddLibrary,
#superclass : #CMakeTemplate,
#instVars : [
'library',
'type',
'sources',
'exclude'
],
#category : #'CMakeVMMakerSqueak-CMakeTemplates'
}
{ #category : #'initialize-release' }
CMakeAddLibrary >> initialize [
library := '<name>'.
type := '[STATIC | SHARED | MODULE]'.
exclude := ' [EXCLUDE_FROM_ALL]'.
sources := OrderedCollection with: 'source1' with: '[source2....]' .
self content:' add_library(', library, ' ' , ' ' , type, ' ' , ' ' , exclude , ' ' ,self sources, ')'
]
{ #category : #accessing }
CMakeAddLibrary >> library: lString type: tString exclude: eString sources: anObject [
library := lString.
type := tString.
exclude:= eString.
sources := anObject.
self content:' add_library(', library, ' ' , ' ' , type, ' ' , ' ' , exclude , ' ' ,self sources, ')'
]
{ #category : #accessing }
CMakeAddLibrary >> library: lString type: tString sources: anObject [
library := lString.
type := tString.
exclude:= ''.
sources := anObject.
self content:' add_library(', library, ' ' , ' ' , type, ' ' , ' ' , exclude , ' ' ,self sources, ')'
]
{ #category : #accessing }
CMakeAddLibrary >> list: aString elements: anObject [
list:=aString.
elements := anObject.
self content:' list( APPEND ', list, ' ' , self elements, ')'
]
{ #category : #accessing }
CMakeAddLibrary >> sources [
self flag:'tty'. "see CMakeListAppend>>elements for inject method to use If I have doublequotes are needed. "
^ String streamContents: [:stream | sources asStringOn: stream delimiter: ' ' ]
]
{ #category : #accessing }
CMakeAddLibrary >> sources: anObject [
sources := anObject
]
{ #category : #accessing }
CMakeAddLibrary >> type [
^ type
]
{ #category : #accessing }
CMakeAddLibrary >> type: anObject [
type := anObject
]